tlmgr in Ubuntu 20.04: "Local TeX Live (2019) is older than remote repository (2020)" (and subsequent issues)

I had the same issue and solved it by reinstalling TexLive.

Firstly, you should uninstall all existing TexLive installations:

sudo apt-get remove texlive*
rm -rf /usr/local/texlive/2020
rm -rf ~/.texlive2020
rm -rf /usr/local/texlive/2019
rm -rf ~/.texlive2019

Next, you must create a place for your new TexLive distribution to live, and give your user ownership of this directory

sudo mkdir -p /usr/local/texlive/2020
sudo chown "$USER" /usr/local/texlive

Download and manually install TexLive

mkdir /tmp/texlive
cd /tmp/texlive
wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl.zip
unzip ./install-tl.zip -d install-tl
cd install-tl/install-tl-$(date +%Y%m%d)
perl ./install-tl

When you are in perl console then press "i" to install

Enter command: i

Post-Installation: you need to add to the path environment

export MANPATH="$MANPATH:/usr/local/texlive/2020/texmf-dist/doc/man"
export INFOPATH="$INFOPATH:/usr/local/texlive/2020/texmf-dist/doc/info"
export PATH=/usr/local/texlive/2020/bin/x86_64-linux:$PATH

Test your installation

latex small2e

I recently have the same problem, you need to edit the path correctly by going to your .bashrc running:

gedit /home/<username>/.bashrc

and setting in the .bashrc file:

export PATH=/usr/local/texlive/2020/bin/x86_64-linux:$PATH
export MANPATH=/usr/local/texlive/2020/texmf-dist/doc/man:$MANPATH
export INFOPATH=/usr/local/texlive/2020/texmf-dist/doc/info:$INFOPATH

(Maybe you need to check your installation folder for this, if it is default then you can use these code). Initially i have only this (Only for check, don´t use this):

export PATH=:$PATH/usr/local/texlive/2020/bin/x86_64-linux
export MANPATH=/usr/local/texlive/2020/texmf-dist/doc/man
export INFOPATH=/usr/local/texlive/2020/texmf-dist/doc/info

When you have corrected the PATH re-run the sh and you can get this:

sh update-tlmgr-latest.sh -- --upgrade
Verifying archive integrity... All good.
Uncompressing TeX Live Manager Updater  100%  
./runme.sh: updating in /usr/local/texlive/2020...
./runme.sh: tlmgr version says this is TeX Live 2020,
./runme.sh: and this updater script created: Wed Jun  3 00:11:12 CEST 2020.
./runme.sh: have TL 2020, new version also 2020;
./runme.sh: using --upgrade doesn't make sense; terminating.
(./runme.sh: makeself creation date = Wed Jun  3 00:11:12 CEST 2020.)

And finally update your tlmgr.

EDIT These steps don't solve the problem for install packages (at least for me). I want to give more steps for finally can install or use your tlmgr, ehwn I try to use tlmgr updated I got:

    You don't have permission to change the installation in any way,
specifically, the directory /usr/local/texlive/2020/tlpkg/ is not writable.
Please run this program as administrator, or contact your local admin.
tlmgr: An error has occurred. See above messages. Exiting.

For solve this you need to install programs following:

sudo env PATH="$PATH" tlmgr install <package> --dry-run

Reference: Last comment in Permission problem when installing package from tlmgr

And if you need, update tlmgr using:

sudo env PATH="$PATH" tlmgr update --self

Or if you want to update all your instalation try:

sudo env PATH="$PATH" tlmgr update --self --all

the short solution is: this error is because your TexLive 2019 is trying to use a TexLive 2020 ftp repository. You should change to the right (correct) repository. Type this commands in a Terminal:

tlmgr repository add ftp://tug.org/historic/systems/texlive/2019/tlnet-final
tlmgr repository list
tlmgr repository remove http://mirror.ctan.org/systems/texlive/tlnet
tlmgr option repository ftp://tug.org/historic/systems/texlive/2019/tlnet-final

After that you can install the package with this command:

tlmgr --verify-repo=none install dirtree

I added the --verify-repo parameter to avoid get this error: tlmgr: unexpected return value from verify_checksum: -5 for main repository

This 2nd error is previously explained here: https://tex.stackexchange.com/questions/537376/tlmgr-unexpected-return-value-from-verify-checksum-5-for-main-repository/537379#537379

Tags:

Ubuntu

Tlmgr