[tex-live] Messed up TL installation
martin.afanasjew at math.tu-freiberg.de
Wed Oct 19 22:42:47 CEST 2011
On 2011-10-19 21:22, Haines Brown wrote:
> My immediate problem is not updating TL 2011, but making sure that my
> TL 2011 is properly configured. I would like to do that as sudo. But
> can't as sudo. For example:
> $ sudo tlmgr -gui
> sudo: tlmgr: command not found
> this because $ sudo which tlmgr returns nothing. The tlmgr is not in
> sudo's environment. Here is where the executable is located:
> # which tlmgr
> And yet this is in sudo's environment:
> $ sudo echo $PATH | grep texlive
> How can this be? If sudo's environment includes the directory holding
> tlmgr, shouldn't sudo be able to run it?
Because your statement from above doesn't print the PATH environment
variable as seen by sudo but the one from your current session. This is
because $PATH is expanded by your shell before sudo gets even executed.
Thus "sudo echo $PATH" and "echo $PATH" result in the same output.
If you want to print the PATH variable as it is seen by sudo you can use
$ sudo /bin/bash -c 'echo $PATH'
(the single quotes are important) which will run another instance of
your shell as root and execute "echo $PATH" in its context.
More information about the tex-live