Add Poppler to Path in Debian

℡╲_俬逩灬. 提交于 2019-12-13 02:39:25

问题


I have just installed poppler on my debian server using the command:

sudo apt-get install poppler-utils

However, when I execute the command:

pdftocairo --help

The function cannot be found, so I assume this program has not automatically linked into my PATH variable. My issue is that I am not very experienced with Linux and I don't know how to find out where poppler installed, nor how to create a link file to Poppler from an existing included PATH location.

Any help would be appreciated, especially if someone can explain how I know where these programs are installing themselves.


回答1:


you should not need to do anything with the PATH - it's the maintainer's task to make everything work "as expected".

your problem could have several reasons:

  • your version of poppler-utils does not come with the pdftocairo binary
  • your version of poppler-utils insatlls pdftocairo into a path that is not in your PATH
  • you (or somebody else) have messed with the PATH, so it doesn't contain the directory where poppler-utils installed the binaries to any more.

so first check whether poppler-utils installs the file (and where to). the following will give you a list of all files installed by the package:

$ dpkg -L poppler-utils
[...]
/usr/bin/pdftops
/usr/bin/pdftocairo
/usr/bin/pdftohtml
[...]

as you can see, on my system - which has poppler-utils 0.18.4-6 installed - the package installed a pdftocairo into /usr/bin which is the default path for all applications, and which should already be in your PATH.

to check your PATH variable do something like

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games

as you can see, my PATH contains /usr/bin, and indeed i can do:

$ pdftocairo --help
pdftocairo version 0.18.4
Copyright 2005-2011 The Poppler Developers - http://poppler.freedesktop.org
Copyright 1996-2004 Glyph & Cog, LLC
[...]

if your PATH does not contain /usr/bin, then something is seriously wrong with your system (for instance, you have tried changing your path and accidentally removed all the previous settings).

in any case, adding a new path to PATH is quite simple; all paths are separated by colons, so you should do something like the following:

$ export PATH=/path/to/my/bin:${PATH}

this will add /path/to/my/bin/ at the beginning of the search-path, so all binaries will now be searched first in /path/to/my/bin/ and then /usr/local/bin and so forth.



来源:https://stackoverflow.com/questions/17332238/add-poppler-to-path-in-debian

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!