Tlmgr: Cannot load TeX Live database from

texliveUbuntu

I recently installed Tex Live 2021 (on ubuntu 16.04) and it partially works but now I am running into trouble when I try to install packages.

I haven't seen my combination of problems anywhere here so maybe it is worth a question…

My current configuration produces:

:~$ which tlmgr
/usr/local/texlive/2021/bin/x86_64-linux/tlmgr

:~$ tlmgr --version
tlmgr revision 59291 (2021-05-21 05:14:40 +0200)
tlmgr using installation: /usr/local/texlive/2021
TeX Live (https://tug.org/texlive) version 2021

:~$ echo $PATH
/usr/local/texlive/2021/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

Which I think means that my installation is correct and also the PATH is correct. But installing via tlmgr doesn't work (e.g. the package "default"):

:~$ sudo tlmgr install default
(running on Debian, switching to user mode!)
tlmgr: Cannot load TeX Live database from https://ftp.yz.yamagata-u.ac.jp/pub/CTAN/systems/texlive/tlnet

This isn't a problem of the specific repostitory, running it again checks a different one:

:~$ sudo tlmgr install --repository http://mirror.ctan.org/systems/texlive/tlnet default
(running on Debian, switching to user mode!)
tlmgr: Cannot load TeX Live database from https://ftp.jaist.ac.jp/pub/CTAN/systems/texlive/tlnet

Any ideas what could be wrong? Other things I should check?

Best Answer

(running on Debian, switching to user mode!) 

shows that is the debian system tlmgr not the one you showed, you need to set the PATH for sudo use as well as your standard path, see for example

https://superuser.com/questions/927512/how-to-set-path-for-sudo-commands