2

I have installed Texlive 2021 on UBUNTU 21.04 from tug.org. I have had to install it as root user since, while trying to install it as simple user he didn't let the installer write in some directories. Following, the guide I have updated the paths in the $HOME/.profile file adding the following expressions:

if [ -d "/usr/local/texlive/2021/bin/x86_64-linux" ] ; then
PATH="$HOME/usr/local/texlive/2021/bin/x86_64-linux:$PATH" 
fi 
if [ -d "/usr/local/texlive/2021/texmf-dist/doc/man" ] ; then
MANPATH="/usr/local/texlive/2021/texmf-dist/doc/man:$MANPATH" 
fi 
if [ -d "/usr/local/texlive/2021/texmf-dist/doc/info" ] ; then 
INFOPATH="/usr/local/texlive/2021/texmf-dist/doc/info:$INFOPATH" 
fi 

This way Latex works fine. As for tlmgr, in root mode, I can open and operate the GUI. I tried, still in root mode (https://www.man7.org/linux/man-pages/man1/manpath.1.htmlin user mode ir says I have to run it in root mode)

tlmgr update --self (and > tlmgr update --self)

It gave me the following message:

(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!

I tried to employ --usermode and --usertree with no success. Finally I wrote

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

This way it works. Any alternative, that saves me copying and pasting those instruction? When writing

echo $PATH, >echo $MANPATH, echo $INFOPATH

the terminal lists the corrects directories. What's missing? I think I should set a PATH, but where? Thanks in advance

UPDATE! (partially solved but not quite)

I copied the $PATH, $MANPATH, $INFOPATH on the .bashrc file. Now tlmgr update -all works fine. Unfortunately, tlmgr update --self responds this way.

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

I have tried to follow the suggestions on the upgrade page of tug.org/texlive without success.

Oskar
  • 103
  • if you installed as root (or better using sudo) then you need to update using the same account so sudo tlmgr update --all you are clearly running a tlmgr from a local texlive 2020 not teh texlive 2021 in your final note – David Carlisle Jul 16 '21 at 21:59
  • 2
    it looks like you are using the debian tlmgr not the texlive 2021 one, try sudo /usr/local/texlive/2021/bin/x86_64-linux/tlmgr update --all – David Carlisle Jul 17 '21 at 11:14
  • Thanks! It works! Do you know hoe to update the path permanently? – Matteo Triossi Jul 17 '21 at 12:43
  • here for example https://askubuntu.com/questions/57915/environment-variables-when-run-with-sudo/713137#713137 – David Carlisle Jul 17 '21 at 13:18
  • Thanks I'll check, but I was too much of an optimist. I didn't wait the end of the process. While the command produced some sort of an updating, the message ended again in (running on Debian, switching to user mode!) (see /usr/share/doc/texlive-base/README.tlmgr-on-Debian.md)

    tlmgr: Local TeX Live (2020) is older than remote repository (2021). Cross release updates are only supported with update-tlmgr-latest(.sh/.exe) --update See https://tug.org/texlive/upgrade.html for details. I'm thinking going back to Ubuntu 20.04 and Texlive 2019.

    – Matteo Triossi Jul 17 '21 at 14:22
  • if you get the user mode message you are running the debian texlive not the one installed in tl2021 make sure your path is set first using the full path in the call doesn't ensure all scripts use the tl2021 versions. – David Carlisle Jul 17 '21 at 16:47

1 Answers1

1

After install texlive 2021 from Installing TeX Live over the Internet:

Add to your .profile:

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

and to .bash_aliases:

alias psudo='sudo env PATH="$PATH"'

Update texlive with:

psudo tlmgr update --all

(I have done this for years, in Ubuntu and Debian)

tatojo
  • 1,331
  • 11
  • 26
  • 1
    This is the solution, but some useful links on it are: https://tex.stackexchange.com/questions/187073/permission-problem-when-installing-package-from-tlmgr https://askubuntu.com/questions/66498/setting-tex-live-path-for-root – Colin Aug 22 '22 at 03:37