16

tlmgr -gui No command 'tlmgr' found, did you mean: Command 'vlmgr' from package 'qdbm-util' (universe) Command 'rlmgr' from package 'qdbm-util' (universe) tlmgr: command not found

Since I downloaded TexLive 2011 from TUGs, shouldn't tlmgr be included? If so, why can't I access it?

I'm on Xubuntu 11.04 64 bit.

Suggested solution did not appear to work:

peter@peter-xfce:~$ export PATH=/usr/local/texlive/2011/bin/x86_64-linux:$PATH
peter@peter-xfce:~$ tlmgr --self --all update
tlmgr: package repository http://ctan.unsw.edu.au/systems/texlive/tlnet
You don't have permission to change the installation in any way,
specifically, the directory /usr/local/texlive/2011/tlpkg/ is not writable.
Please run this program as administrator, or contact your local admin.
peter@peter-xfce:~$ sudo tlmgr --self --all update
[sudo] password for peter: 
sudo: tlmgr: command not found
peter@peter-xfce:~$ tlmgr
/usr/local/texlive/2011/bin/x86_64-linux/tlmgr: missing action; try --help if you need it.
peter@peter-xfce:~$ tlmgr --help
You need to install the perl-doc package to use this program.
peter@peter-xfce:~$ 
ptrcao
  • 6,603
  • Where did you install TeXLive? What's your current $PATH?

    See http://www.tug.org/texlive/quickinstall.html

    – Martin Schröder Aug 27 '11 at 10:55
  • Defaults, all defaults: /usr/local/texlive/2011 – ptrcao Aug 27 '11 at 10:58
  • 3
    root has it's own path, so you need to make sure tlmgr is included in root's path before sudo tlmgr ... will succeed. –  Aug 27 '11 at 11:23
  • 1
    I'm not sure I understand - does this mean I have two separate TextLive installations? The path is where I installed it to right, /usr/local/texlive/2011 initially? Why should it be different for root versus user? – ptrcao Aug 27 '11 at 22:31

6 Answers6

16

This will solve your problem:

sudo env PATH="$PATH" tlmgr --gui

Basically, sudo resets the value of $PATH (the whole environment, indeed) to a "known good" one, and is thus ignoring any changes you made to your local environment. The env command above sets the PATH variable in the environment of the tlmgr it executes, so it runs with the value of $PATH you specify on the command line.

Setting TeX Live path for root - Ask Ubuntu

Of course to get this working you'll have to add the TeX Live 2011 installation path to your PATH variable.

(For the GUI install the perl-tk package.)

szantaii
  • 4,719
  • 2
  • 36
  • 51
15

try the following:

export PATH=/usr/local/texlive/2011/bin/x86_64-linux:$PATH

and then run tlmgr --self --all update. Does it work?

To set the path correctly with every login put the following as zzz-texlive.sh into /etc/profile.d/.

export PATH=/usr/local/texlive/2011/bin/`uname -i`-linux:$PATH
export MANPATH=/usr/local/texlive/2011/texmf/doc/man:$MANPATH
export INFOPATH=/usr/local/texlive/2011/texmf/doc/info:$INFOPATH
unset TEXINPUTS
unset TEXMFCONFIG

And you should always use updmap-sys, fmtutil-sys, if needed for installing additional fonts or creating new formats.

  • See above. What appears to be the problem? – ptrcao Aug 27 '11 at 11:09
  • 1
    use sudo tlmgr --self --all update. You installed it as root, I personally prefer installing it as user. And, of course, have you installed perl? You also have to set the PATH variable as root –  Aug 27 '11 at 11:11
  • Yep, I saw that warning, but I repeated with sudo immediately after the warning. It gave sudo: tlmgr: command not found. Suggestions? – ptrcao Aug 27 '11 at 11:14
  • do it as root with su <enter>. Then set the path and run tlmgr. However, I would prefer the owner change of texlive: sudo chown -R peter.users /usr/local/texlive then you can do everything as user. –  Aug 27 '11 at 11:17
  • 1
    Presumably the installation couldn't have proceeded without perl? I installed tk-perl. perl I assumed was pre-installed cause the manual says it's default on Linux. Also sudo export PATH=/usr/local/texlive/2011/bin/x86_64-linux:$PATH gives sudo: export: command not found – ptrcao Aug 27 '11 at 11:19
  • I don't know why it wouldn't authorize me as su, but I did sudo chown -R peter.users /usr/local/texlive and repeated the actions, and all seemed in order. Problem appears solved, but I still wonder if there was any reason why su was rejected, assuming I typed in my p.word correctly? – ptrcao Aug 27 '11 at 11:25
  • 1
    I suppose that Ubuntu doesn't allow su. But I am not sure, I am on SuSE. I'll update my answer in a couple of minutes to show, what you should do to set the path correctly at every system start. –  Aug 27 '11 at 11:30
  • Wow, thanks. I'm still not sure what "setting the path" refers to and why I'm having these problems. Could you explain what this is all about? Judging from your extended solution, would I expect this to be a recurring problem? – ptrcao Aug 27 '11 at 11:36
  • 1
    TeXLive does no changes to the system configuration and leaves all to the user. You can have several TeXLive installation on your system, eg 2010 and 2011. Resetting the path to another TeXLive Version is all what to do when switching to another TeXLive version. –  Aug 27 '11 at 11:42
2

I just had this problem, and the solution is slightly trickier than the above.

First, su works slightly differently in Ubuntu. As explained in this AskUbuntu question, you need to call

sudo su

Since root has its own path variable, you need to set your path variable. To do this, you need to include

export PATH=$PATH:/usr/local/texlive/2013/bin/x86_64-linux/

or its local equivalent in the .bashrc, which is located at /root/. To make the changes effective, save the file and run source .bashrc & in that terminal.

After that, you can start tlmgr in that terminal, as root, using

tlmgr -gui

or you can run updates using

tlmgr --self --all update

E.P.
  • 1,415
1
$which latex

return for 32 bits

/usr/local/texlive/2011/bin/i386-linux/latex

or for 64 bits

/usr/local/texlive/2011/bin/x86_64-linux/latex

for update

$sudo /usr/local/texlive/2011/bin/i386-linux/tlmgr update --self

for full upgrade

$sudo /usr/local/texlive/2011/bin/i386-linux/tlmgr update --all
Regis Santos
  • 14,463
0

This is a more general question about how sudo is working.

Instead of setting environment variable PATH, you can run something like sudo $(which tlmgr) update --self. Be sure to check the path of which tlmgr is what you expected.

Meta Fan
  • 101
-1

This is because of the differences in sudo and user PATH variable. In your case, you can either change the sudo safe path, which is not recommended, or just change the access of your Tex Live directory by running the following command:

sudo chmod 777 -R /usr/local/texlive/

Then you can use the following command for installing your packages without sudo:

tlmgr install <package_name>
Reza
  • 103
  • 1
    I wouldn't recommend to give full read-write access to the TeX Live tree to any and all users. It is both unnecessary and may easily lead to trouble. – gusbrs May 07 '18 at 20:40
  • Reza, in thinking better here, the advice you give is quite dangerous. Picture the following scenario: You build your document and latex warns of an error in a package, you select the error and your editor opens the package file, you inadvertently type something in the file, you try to build again and your editor saves all files. And, there you go, you have broken installation. I appreciate your will to participate, and I wish I could be more welcoming. But I'll have to flag your answer for moderation attention. – gusbrs May 07 '18 at 20:56
  • 2
    Btw, I also strongly recommend you don't use this yourself. – gusbrs May 07 '18 at 20:57
  • Well, although you are correct about the safety of doing my way, but some of mentioned ways is more dangerous than my way and you can think of lots of ways to do something wrong with for example changing sudo safe path! But in my case, the only possibility is to broke a package or broke the whole installation. In addition, every linux user, should be careful about the power of sudo command and giving an access to a file. Power brings responsibilities :) – Reza May 07 '18 at 21:31