54

I would like to know how to properly install, and use texlive along with the package manager tlmgr in Ubuntu. Here is what I did to install texlive:

sudo apt-get install texlive-latex-base texlive-latex-extra texlive-latex-recommended

And now I do have texlive, but the package manager is not working. Following is the error

sudo tlmgr update -all
(running on Debian, switching to user mode!)
cannot setup TLPDB in /home/kniwor/texmf at /usr/bin/tlmgr line 5336.

Is there a better way to install texlive? What can I do to fix the package manager at this point?

ste_kwr
  • 11,210
  • 2
    If you do not have any space issues you can go ahead and install the full texlive package: sudo apt-get install texlive-full – D-unit Jun 19 '14 at 14:32
  • 2
    Thanks. However I prefer to install only what I need. Mostly because I like to know what I'm using since I use multiple computers to compile my files(work/home etc) and some of them have space issues. – ste_kwr Jun 19 '14 at 14:35
  • See also: http://tex.stackexchange.com/questions/114623/installing-texlive-on-ubuntu-revisited – landroni Jan 07 '15 at 16:59

3 Answers3

64

Just run tlmgr init-usertree first and then run sudo tlmgr update --all.


Maybe you will get:

/usr/bin/tlmgr: Initialization failed (in setup_unix_one):
/usr/bin/tlmgr: could not find a usable xzdec.
/usr/bin/tlmgr: Please install xzdec and try again.
Couldn't set up the necessary programs.
Installation of packages is not supported.
Please report to texlive@tug.org.
tlmgr: exiting unsuccessfully (status 1).

If so, you have to install the xzdec package, from your package manager or through sudo apt-get install xzdec.


To use the GUI, you also need to install perl-tk:

sudo apt-get install perl-tk

Then you can summon the GUI via:

tlmgr --gui

And then hit the Load Default button.

landroni
  • 5,941
  • 7
  • 36
  • 58
  • 5
    This works fabulously. – ste_kwr Jun 23 '14 at 18:24
  • TeXLive 2013 version included in Ubuntu 14.04 may stop working with tlmgr, since TeXLive 2014 was released in the meantime. See: http://askubuntu.com/questions/486170/upgrade-from-tex-live-from-2013-to-2014-on-ubuntu-14-04 – landroni Jan 07 '15 at 19:24
  • 1
    I was missing the xzdec package on a fresh installation of 16.04. Worked fine afterwards! – Daniel Jul 06 '16 at 17:34
2

If you want to use tlmgr on Ubuntu you basically have two options:

  1. Install texlive from scratch and create a dummy package

  2. Use install-tl-ubuntu, as described in this answer on tex.SE

Glutanimate
  • 21,393
0

The answer provided by @Kyle_the_hacker gave a straightforward way to setup the user mode management, which is required for Debian-based distros. However, at the time I am writing this answer, before doing anything, update all yields

❯ sudo tlmgr update -all
(running on Debian, switching to user mode!)
(see /usr/share/doc/texlive-base/README.tlmgr-on-Debian.md)
TLPDB: not a directory, not loading: /root/texmf
tlmgr: user mode not initialized, please read the documentation!

The .md contains

TeX Live Manager (tlmgr) on Debian
==================================

Rationale

The TeX Live Manager (tlmgr) is the main configuration and package management program in upstream TeX Live. Thus, the Debian TeX Team has often received requests for providing tlmgr in Debian.

Since package management (installation, update, ...) is the responsability of APT (apt, apt-get, ...), tlmgr cannot interfere with it, but uses the "TeX Live Manager User Mode" instead.

For details concerning the User Mode, see https://tug.org/texlive/doc/tlmgr.html#USER-MODE

Warning

tlmgr on Debian automatically switches to user mode. Consequences of this are:

  • an initial setup step is necessary (see the documentation)
  • packages will be installed into TEXMFHOME which normally is $HOME/texmf
  • packages installed into TEXMFHOME will override system-wide installed packages, that means a later system update will not be seen by TeX
  • not all packages can be installed using the user mode, see the above link for details

We strongly recommend not to user the TeX Live Manager user mode on Debian. If you are using it despite the warnings, be prepared to fix your own TeX system.

If you want the full power of TeX Live Manager, we recommend installing TeX Live from upstream https://tug.org/texlive/quickinstall.html See also "Integrating vanilla TeX Live with Debian" here https://tug.org/texlive/debian.html

Although it says it isn't recommended to use tlmgr on Debian, if you follow the @Kyle_the_hacker's steps, you might get this error

❯ tlmgr update -all
(running on Debian, switching to user mode!)
(see /usr/share/doc/texlive-base/README.tlmgr-on-Debian.md)

tlmgr: Local TeX Live (2021) is older than remote repository (2023). Cross release updates are only supported with update-tlmgr-latest(.sh/.exe) --update See https://tug.org/texlive/upgrade.html for details.

If you installed TeX Live from the Ubuntu's package manager (apt, probably from the texlive-full package), AFAIK you can do nothing if the latest version available on apt isn't the most updated version...

Therefore, the accepted answer didn't work for these cases. Instead, you must install the CTAN package manually by following these steps:

  1. Download A package from CTAN.
  2. Extract the files and place them in an appropriate directory (e.g. /usr/local/share/texmf/tex/latex/footmisc/).
  3. [Opitional, some packages already have the .sty file] Generate the .sty file by running latex on the appropriate source files (e.g., latex footmisc.ins and latex footmisc.dtx).
  4. Update the ls-R file in this source tree: cd /usr/local/share/texmf/; sudo mktexlsr.

This way worked for me. For more info, see here