2

I installed TexLive from https://www.tug.org/texlive/quickinstall.html in Ubuntu 18.04.

I have tlmgr

which tlmgr
/usr/local/texlive/2018/bin/x86_64-linux//tlmgr

I try

tlmgr install tex-gyre

and get:

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

Trying

sudo tlmgr install tex-gyre

I get

sudo: tlmgr: command not found

Trying sudo su first I get

Command 'tlmgr' not found, but can be installed with:

apt install texlive-base

How to perform this operation?

  • It is not found because it is not in the path. – Sigur Jan 16 at 22:30
  • What are the permissions of this folder? What does ls -l /usr/local/texlive/2018/ say? – user36296 Jan 16 at 22:31
  • 1
    You can call it passing the path /usr/local/texlive/2018/bin/x86_64-linux/tlmgr – Sigur Jan 16 at 22:32
  • I suspect that you didn't add binaries to the PATH after installed TeXlive. – Sigur Jan 16 at 22:33
  • @Sigur, adding /usr/local/texlive/2018/bin/x86_64-linux/ after doing sudo su worked – Viesturs Jan 16 at 22:35
3

The $PATH used by sudo is different from the one used by $USER, so if the $PATH does not include, in your case, the path /usr/local/texlive/2018/bin/x86_64-linux/, then sudo will not be able to find tlmgr.


On Ubuntu, I highly recommend that you can install texlive via apt. See the Ubuntu package database for a list of all packages related to texlive. Also, from the same domain as you provided, they have a page specifically written for Debian-based (which Ubuntu is based on) systems. If you choose to install the full distribution of texlive, you will not have to install texlive packages using tlmgr and just let apt (the package manager for Debian-based systems) handle that for you. Otherwise, you will only need to run tlmgr with the sudo command, except now the distribution from apt should provide a symlink (or equivalent) to a path that your root account refers to.

However, as pointed out in the subcomments, texlive on apt is possibly outdated.


If disk space is a serious concern, and/or if you are comfortable with the command line, I highly recommend that you install tlmgr as a user instead of root. Follow the guide from Wikibooks for a minimal installation process. Last time I checked, the guide is still up to date. The important point to install tlmgr so that it does not require root access is the following:

  1. You may want to change the directory options. For example you may want to hide your personal macro folder which is located at TEXMFHOME. It is ~/texmf by default. Replace it by ~/.texmf to hide it.

You will need to change the default /usr/local/ to your home directory.

If disk space is not of your concern, then just choose the full distribution schema.


Edits: See also @daleif's comment under this reply, especially these two sentences:

Ubuntu texlive is quite out of date and split into a myriad of Ubuntu packages. So a lot of users do not recommended using the apt version

Just more information for you to watch out for when deciding which installation path you wish to go down.

  • 5
    Note that the Ubuntu texlive is quite out of date and split into a myriad of Ubuntu packages. So a lot of users do not recommended using the apt version. Figuring out which unubutu texlive package to install to get a given latex package is a pain. – daleif Jan 17 at 6:50
  • Thanks for the info @daleif. I don't use a Debian-based distribution myself so I am not aware of that. I'll put a note in my answer. – Japorized Jan 17 at 17:13
  • It is an issue with most Linux dists that provide TeXLive. Some even take TeXLive year X before it is released, and thus may ship one that contains errors. – daleif Jan 17 at 17:15
  • I suppose that its a problem that stems from the philosophy that goes behind distributing packages on a distribution, though it may be the case that this applies only to how texlive is being handled. That said, archlinux seems to keep its repo updated. – Japorized Jan 17 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.