pdf-tools icon indicating copy to clipboard operation
pdf-tools copied to clipboard

install pdf-tools without sudo privileges

Open Nathanael8 opened this issue 2 years ago • 2 comments

Hello,

I tried to install pdf-tools within my doom-emacs setup. I know that i need to install some dependencies. I already asked my system admin to install these dependencies on my machine. However, when I try to install pdf-tools by M-x pdf-tools-install, then emacs still ask me for my sudo password which I obviously do not have.

Is there a way to bypass this?

Nathanael8 avatar Sep 30 '21 22:09 Nathanael8

Another way to install is to install pdf-tools' package from your package manager. See: https://repology.org/project/emacs-pdf-tools/versions Contact your sys admin to install them for you then put

  (pdf-loader-install)

in your config file and you're done.

c1-g avatar Dec 03 '21 09:12 c1-g

Hi @Nathanael8 ,

There's definitely a way to install pdf-tools without sudo.

PDF tools only asks for sudo in two cases:

  1. If it detects that all the system dependencies are not installed correctly.
  2. If the path where you are trying to install the pdf-tools server is not writeable.

Please review / share the dependencies that you've asked the sysadmin to install, and please review / share the value of pdf-info-epdfinfo-program in your setup.

vedang avatar Dec 31 '21 02:12 vedang

I'm not the OP, so my situation is different, but perhaps related enough to be useful. I'm on my own Ubuntu 20.04 system, running GNU Emacs 26.3. I got this via package-install: http://melpa.org/packages/pdf-tools-20220214.344.tar I ran M-x pdf-tools-install, and it said:

Need to (re)build the epdfinfo program, do it now ? (y or n) y with no explanation of why it needed to rebuild it.

If I answer "y" it asks for a sudo password, with no info on why that requires sudo. With no evident info or clarity on any package signatures, provenance, etc, or evident listing of exactly what build commands it intends to run as root, that sets off my personal security alarm bells.

I'm guessing that I could somehow just tell it to install the server in a different place by setting INSTALL_DIR somewhere, but I'm not sure how.

Thanks for any help you can provide!

nealmcb avatar Oct 21 '22 04:10 nealmcb

To influence the install-directory for epdfinfo you should set the variable pdf-info-epdfinfo-program.

Note that this variable expects the full name of the epdfinfo binary. (i.e. if you set it as "/path/to/bin/epdfinfo"), it will expect that "/path/to/bin" exists and will try to write the binary there. Set the variable, and then call M-x pdf-tools-install

vedang avatar Jun 10 '23 14:06 vedang