192

I'm trying to update my installation of texlive 2013 under Ubuntu 13.10. However, I followed the instruction on this answer, but I get an error

(running on Debian, switching to user mode!) cannot setup TLPDB in /home/USER/texmf at /usr/bin/tlmgr line 5308.

I tried searching for this error but got me nowhere. I'm used to work with MikTex on Windows, but now I'm migrating to Ubuntu and get no idea what went wrong nor where. Any pointers are welcomed.

  • 1
    It seems you have created symbolic links in /usr/bin, which I don't recommend. It's much better to add the path to the TeX Live binaries to the PATH environment variable. It's possible that you have also the Debian provided TeX Live and, if some package has been installed later than the vanilla TeX Live, tlmgr gets confused. – egreg Oct 11 '13 at 17:10
  • 1
    The installation with apt-get doesn't provide tlmgr; and the instruction you refer to don't use apt-get. – egreg Oct 11 '13 at 17:14
  • 2
    Personally I avoid apt-get for texlive and use How to install "vanilla" TeXLive on Debian or Ubuntu? – cmhughes Oct 11 '13 at 17:14
  • 4
    @egreg tlmgr is included in package texlive-base in Ubuntu 13.10, preset to run in user mode. The first line in the documentation is a warning that one should expect breakage. – scottkosty Oct 28 '13 at 4:57
  • 4
    @adn I just tried on virtual box with 13.10 and I can reproduce your problem. It's strange that others have not experienced this (google results are few). One option is to uninstall the Ubuntu packages and use install-tl-ubuntu. It has been tested on 13.10. – scottkosty Oct 29 '13 at 5:57
181

Sorry to reactivate this old post but there was no correct answer.

The message :

(running on Debian, switching to user mode!) cannot setup TLPDB in /home/USER/texmf at /usr/bin/tlmgr line 5308.

is generated when tlmgr was not initialized. In most cases, launching the following command (as a normal user) solves the problem :

 $ tlmgr init-usertree

This command will create few folders inside your home directory. See the man page for explanation :

Before using tlmgr in user mode, you have to set up the user tree with the init-usertree action. This creates usertree/web2c and usertree/tlpkg/tlpobj, and a minimal usertree/tlpkg/texlive.tlpdb. At that point, you can tell tlmgr to do the (supported) actions by adding the --usermode command line option.

  • 41
    Running this command still gives (running on Debian, switching to user mode!) cannot setup TLPDB in /home/adin/texmf at /usr/bin/tlmgr line 5308. – adn Nov 28 '13 at 1:32
  • 7
    Indeed! I just checked bugs reports and your problem is related to a bug in ubuntu 13.10 package. See post #3 and #4 in the bug report. You have to wait the update (probably with the next version of ubuntu) or to install manually texlive (without using ubuntu package). On my debian unstable, the bug is fixed and tlmgr works fine. – ppr Nov 28 '13 at 9:57
  • 2
    To me it just changed errors, now I get: "tlmgr: could not find a usable xzdec" – Lucas Soares Sep 7 '16 at 11:03
  • 5
    @LucasSoares You might want to install xzdec package. See Taciano answer or tex.stackexchange.com/questions/180230/… – ppr Sep 9 '16 at 12:41
  • 1
    @LucasSoares It is a decompression tool. It allows you decompress the binary you want to install. – ppr Sep 9 '16 at 14:08
102

In my texlive installation (in ubuntu 15.04), I tried installing framed.sty latex package with the following command:

$ tlmgr install framed

I got this error message:

(running on Debian, switching to user mode!)
cannot setup TLPDB in /home/myusername/texmf at /usr/bin/tlmgr line 5435.

I took the following steps:

$ cd ~
$ mkdir texmf
$ tlmgr init-usertree

I tried to install the framed.sty latex package again with the command:

$ tlmgr install framed

I got this error message:

/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).

So, I installed xzdec and I tried to install the package again:

$ sudo apt-get install xzdec
$ tlmgr install framed

It worked!

(running on Debian, switching to user mode!)
tlmgr: package repository http://linorg.usp.br/CTAN/systems/texlive/tlnet
[1/1, ??:??/??:??] install: framed [8k]
tlmgr: package log updated: /home/myusername/texmf/web2c/tlmgr.log
running mktexlsr ...
done running mktexlsr.
  • 2
    Installing "xzdec" worked for me, as well! – smh Jan 12 '18 at 9:30
  • 5
    still the only working solution in 18.04 – tigerjack89 Jun 1 '18 at 14:24
  • working great for me. – David Beauchemin Jul 24 '18 at 23:57
  • 1
    I already get "Cannot determine type of tlpdb from..." when I run tlmgr init-usertree. – Kvothe Feb 14 at 15:03
7

The version installed by the command:

$sudo apt-get install --reinstall texlive-base

is outdated. I had to download the most up-to-date version from: http://ftp.leg.uct.ac.za/pub/packages/ctan/systems/texlive/tlnet/

It included most of the current packages. To install it you have to remove the old versions of tex-live you may have:

   sudo rm -rf /usr/local/texlive/*
   sudo rm -rf ~/.texlive*

Some more info about quick installation can be gleaned from: http://tug.org/texlive/quickinstall.html

5

I had this issue and fixed it thus:

sudo apt-get install xzdec
tlmgr update --self
tlmgr install etoolbox titling

I was getting the error

cannot setup TLPDB in /home/tama/texmf at /usr/bin/tlmgr line 5336.

when trying to run:

sudo tlmgr update --all

So I tried to update tlmgr, thinking it an issue with ubuntu's packaged version of tlmgr.

~$ tlmgr update --self
(running on Debian, switching to user mode!)
/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).

So it turns out to be two errors; (1) Ubuntu packages tlmgr but not its dependent program, xzdec, and (2) tlmgr outputs the wrong error message; it should have said "unable to find xzdec" but instead said something general and vague about TLPDB.

  • Welcome to TeX.SX! This seems to be restricted to an update of some packages only, not complete TLPDB – user31729 Aug 2 '15 at 10:54
  • 2
    This seemed to help at the beginning , but when trying to do anything when tlmgr I get: Unknown directive ...containerchecksum 06c8c1fff8b025f6f55f8629af6e41a6dd695e13bbdfe8b78b678e9cb0cfa509826355f4ece20d8a99b49bcee3c5931b8d766f0fc3dae0d6a645303d487600b0... , please fix it! at /usr/share/texlive/tlpkg/TeXLive/TLPOBJ.pm line 210, <$retfh> line 5761. – relG Sep 1 '17 at 12:45
4

I reinstalled the TeX Live by using install-tl-ubuntu and it worked.

However, it is a rigorous solution for the given issue. So, I would only suggest you to perform this after you've tried rest of the answers here.

3

For me (on Ubuntu 13.10 with TeX Live 2013) I solved the problem by re-installing the texlive-base package.

# sudo apt-get install --reinstall texlive-base

I installed my tex-dist with the normal installer, not the install-tl-ubuntu.

  • 6
    Unfortunately for me reinstalling texlive-base didn't help – Patryk Nov 25 '13 at 2:09
3

I was able to fix this by rearranging the PATH command in .bashrc. The problem manifested itself when the path was set like this:

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

However, changing to this:

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

fixed the problem. I do not have TeXLive installed under the Ubuntu Software Centre, I installed it manually from install-tl.

  • 2
    It is not a good idea to add the PATH to the .bashrc, then several editors will not be able to find LaTeX if the editor is started via a menu. Better to add it to .profile and log out and in again (that file is only read once per session AFAIK) – daleif Mar 28 '14 at 16:23
  • Thanks @daleif. I found setting the path confusing under Ubuntu... for example, it is unclear to me from this post exactly where the path should be updated to be seen by the most applications. Editing .bashrc seemed to be the most appropriate. – Axio Mar 28 '14 at 16:54
  • Discovered that though TexLive is not installed according to the software centre, it is part of the base install of Ubuntu 13.10 and I removed it with apt-get. Now the order in $PATH does not matter. Sorry for the confusion. – Axio Mar 28 '14 at 18:45
  • 2
    I get this: (running on Debian, switching to user mode!) /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. – Stéphane Laurent May 28 '14 at 7:40
  • 3
    @StéphaneLaurent I got the same thing which seemed to have been fixed by sudo apt-get install xzdec. – OSE Nov 21 '14 at 18:37
-1

I got here after

tlmgr install luainputenc

didn't work for me.

To conclude, what worked for me was:

sudo apt-get install --reinstall texlive-base
tlmgr init-usertree

tlmgr install luainputenc

So thanks, everyone! :)

  • 3
    Welcome to TeX.SX! This is rather a summary of some of the answers here – user31729 Dec 30 '14 at 8:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.