i am new to Ubuntu and have Ubuntu 14.04.02 installed on my computer. I wanted to install the latest latex and so I downloaded and extracted the file from install-tl-unx.tar.gz and according to instructions given here.

I wrote the command ./install-tl and after that wrote i for installing latex on harddisk.but it was showing

./install-tl: mkdir(/usr/local/texlive/) failed, goodbye: Permission denied

what should I do ?


Using administration rights via sudo

sudo ./install-tl

You could also install texlive-full or texlive via the package manager by:

sudo apt-get install texlive-full


sudo apt-get install texlive
  • 2
    I see two problems here. 1. The TeXLive team doesn't recommend using sudo. 2. Installing texlive via apt is not recommended. apt often has older versions of texlive which may create problems in the future. – nikhilweee Mar 9 '18 at 19:48

As @nikhilweee already mentions, sometimes you cannot or do not want to use sudo, so you want to install to your users' directory. There are at least two ways you can go about this.

  1. You can set the following environment variables,

as per this SO answer:

export TEXLIVE_INSTALL_PREFIX=/home/your_user/texlive
export TEXLIVE_INSTALL_TEXDIR=/home/your_user/texlive/2018

and then install with ./install-tl.

  1. You can use a texlive.profile file for installation and change all the /usr/local paths to /home/your_user, then install with ./install-tl --profile=texlive.profile.

@nikhilweee is right. Don't use sudo.

TeXLive installation scripts cannot cater to the myriad of folder structures and permissions.

When you have access to sudo

The best installation method is the official method. Stay with the official folder location /usr/local by doing a cd /usr/local then a sudo mkdir texlive && sudo chown `whoami` texlive.

The install-tl script will then run without a hitch.

Staying with the default folder location lets you write documentation and instructions (for your team) easier. The official guides for TeXLive uses that folder location, so your team can get some self-help browsing those guides themselves. Also, 3rd-party packages (like Atom editor) can be easily configured given standard TeX Live folder locations.

When you have no access to sudo

See answer from @PHPirate at here.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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