tex live 2021 installation question

Zdenek Wagner zdenek.wagner at gmail.com
Wed Aug 18 11:05:11 CEST 2021


Hi,

TeX Live should preferably be installed by a regular user but
/usr/local is writable by root only. When making the very first
installation you must create directory /usr/local/texlive as root and
change its ownership to the user who will the run installation.

Zdeněk Wagner
http://ttsm.icpf.cas.cz/team/wagner.shtml

st 18. 8. 2021 v 4:19 odesílatel Vladimir Lomov <lomov.vl at yandex.ru> napsal:
>
> Hello,
>
> (from TeX Live and Archlinux user here ;)
>
> ** Bob <bobabc at bellsouth.net> [2021-08-17 16:15:01 -0400]:
>
> > Hi All,
>
> > I am attempting to do a new installation of tex live 2021 on a new
> > installation of fedora 34.  When running the installer, I received the msg:
>
> > Enter command: I
> > Installing to: /usr/local/texlive/2021
> > install-tl: mkdir(/usr/local/texlive/) failed for tree
> > /usr/local/texlive/2021: Permission denied at tlpkg/TeXLive/TLUtils.pm line
> > 999, <STDIN> line 4.
>
> How do you used to install TeX Live earlier? What did you run to install TeX
> Live this time?
>
> > What is the best solution?  Should I just mkdir /usr/local/texlive and give
> > write permission to all?
>
> It depends on your experience, how you plan to use and maintain TeX Live
> installation.
>
> > I found something from archlinux at:
>
> > https://bbs.archlinux.org/viewtopic.php?id=183146
>
> Which has following topic name: "'Best' way to install programs?" dates 2014
> and has very good answers:
>
>   Even if you compile from-source, you should still install using pacman.
>   PKGBUILDs are your friends.
>
>   I'd highly recommend staying away from compiling from source. If you don't
>   know how to make a PKGBUILD for whatever it is you're compiling by hand,
>   you'll probably regret doing it.
>
>   Wether you build packages from source or use binary packages from the repos
>   you should install using pacman. If you want a package that is not in the
>   repos nor in the AUR find the source and write PKGBUILD for it. After that
>   feel free to submit it to AUR.
>
> And even this one
>
>   TeX is an exception. There are two good ways to install TeX Live. One is to
>   use pacman. The other is to use the upstream installer....
>
> I use both: I install TeX Live packages provided by distribution (thank
> goodness I'm using Archlinux not RPM/DEB based distributions).
>
> > that recommends creating a new user:
>
> If you don't understand why you need a new user why would you bother go that
> way?
>
> Quote from 'cfr' user (which advice you want to follow):
>
>   I also recommend *not* installing as root. This is also in line with
>   upstream's recommendation.
>
> That's not entirely true. Quoting from http://www.tug.org/texlive/quickinstall.html
>
>   You do not need to be root (administrator on Windows) to install, use, or
>   manage TeX Live. Indeed, we recommend installing it as a normal user, except
>   perhaps on MacOSX, where it's conventional to install as administrator.
>   (Some information about shared installations.) As always, you need to have
>   permission to write into the destination directory, but TeX Live itself does
>   not care if you are root or not.
>
> You have option: either to install as root or as ordinary user but in that
> case you have to have write permissions to installation directory.
>
> Just run as an user (if there is no such directory)
>
> $ mkdir /usr/local/opt/texlive
>
> If you don't have root rights then you don't have write permissions to
> /usr/local/opt directory and that command would fail.
>
> > ==============
>
> > I also recommend *not* installing as root. This is also in line with
> > upstream's recommendation. What I did was create a new user and group
> > (texlive:texlive). As root, I also created the directory /usr/local/texlive
> > and made sure it was owned by the texlive user. Then I logged in as that
> > user to install. This works well. Neither the installer nor later use of the
> > utilities can touch your home directory or system files. There is no
> > downside to this - it is no less convenient than having the installation
> > owned by root. So you gain a security benefit for no cost. (Or minimal cost:
> > you have to create a single user and group, make one new directory and chmod
> > that directory appropriately.)
>
> > # adjust options as desired
> > useradd -d /usr/local/texlive -m -g texlive -r -s /bin/sh texlive
>
> > Set a password for the new account, and check ownership and permissions on
> > the new directory:
>
> > drwxr-xr-x   7 texlive texlive 4.0K Meh  26 02:14 .
>
> > Then log in as texlive and install.
>
> > =================
>
> > What is the recommended way to solve this permission problem?
>
> Follow three top answers: use your distribution package manager and your
> distribution packages.
>
> > --Bob
>
> P.S. If you really want to install TeX Live (TUG, not distribution packages)
> you have some options. There are many ways depending on context: what kind of
> system you have, how many free space you have, what is your daily tasks, how
> much you experienced are, do you want to understand how your system work and
> etc. Due to these many factors the TeX Live manual doesn't describe any
> particular way because that would be treated (by someone) as "recommendation".
> And of course it's impossible to cover all possible variants.
>
> Nevertheless, I'll try to describe two possible ways.
>
> 1. Install as root. When this applicable: you have root rights (you could run
>   commands through sudo), have enough free disk space and you don't mind to do
>   administration task, for example, to update TeX Live packages.
>
>   I won't tell you how to check if you able to run commands through sudo, you
>   could check that yourself.
>
>   I suppose that you want to install TeX Live into /usr/local/opt/texlive/2021
>   because /usr/local (or /, or /usr, or /usr/local/opt) has plenty of space,
>   at least 9Gb.
>
>   You downloaded install-unx.tar.gz, unpacked it, changed current directory to
>   install-2021XXXX and now run 'install-tl' as root:
>
>     $ sudo ./install-tl
>
>   You will be asked to where install TeX Live. You could either change path in
>   menu and installer will create necessary directory itself or create it
>   separately, for example, before you run 'install-tl'
>
>     $ sudo mkdir -p /usr/local/opt/texlive/2021
>     $ sudo ./install-tl
>
>   Also you could choose either to make symbolic links in /usr/local/bin
>   (actually I don't remember to where the links are created) or not but then
>   you have to know how to add /usr/local/opt/texlive/2021/bin/x86_64-linux to
>   PATH variable.
>
>   In general, it is very simple. But there are pitfalls.
>
>   a) The installation will be owned by root user so to make any changes, for
>   example, to update packages, you have to run commands as root. For instance,
>   to update installed packages:
>
>     $ sudo tlmgr update --self
>     $ sudo tlmgr update --all
>
>   b) If you chosen to make symbolic links in /usr/local/bin you couldn't use
>   several TeX Live installations in parallel in simple way (see below) and you
>   have to remove previous TeX Live installation if you want to upgrade (2021
>   -> 2022) (I don't use symlinks so I actually don't check correctness of
>   this).
>
>   c) If you don't use symlinks in /usr/local/bin, for example, you have
>   several TeX Live installation in parallel, say /usr/local/opt/texlive/2020,
>   /usr/local/opt/texlive/2021, /usr/local/opt/texlive/2022 (in future) you
>   should know how to append 'bin/x86_64-linux' path to PATH variable (or
>   change it). Details depend (a bit) on what shell do you use: bash, zsh,
>   tcsh, fish...
>
> 2. Install as ordinary user. There are two variants here: you either have root
>   rights but still want to install TeX Live as ordinary user or you don't have
>   root rights but have enough free space, say in your home directory.
>
>   a) If you have root rights just run
>
>       $ sudo mkdir -p /usr/local/opt/texlive/2021
>       $ sudo chown $(id -un).$(id -gn) /usr/local/opt/texlive/2021
>       $ ./install-tl
>
>     Note that you should run last command as ordinary user. Then you have to
>     add /usr/local/opt/texlive/2021/bin/x86_64-linux to your user PATH
>     variable (see 1.c) above).
>
>   b) If you don't have root rights but have free space in $HOME directory. Run
>   installer but choose $HOME/texlive/2021 as installation directory. Don't
>   forget to add $HOME/texlive/2021/bin/x86_64-linux to PATH variable!
>
> As you see there are many ways to install TeX Live and they vary by details
> depending on context.
>
> ---
> WBR, Vladimir Lomov
>
> --
> Artistic ventures highlighted.  Rob a museum.



More information about the tex-live mailing list.