tlmgr cannot setup TLPDB

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.


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 [email protected].
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.

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