Install Tex Live 2011 on Ubuntu 12.04

The default Tex Live package in Ubuntu 12.04 is very outdated (version 2009) which is bad because it does not contain e.g. the paralist package that is great for making compact lists. This is easy to fix, just install the newest Tex Live directly from the source (Tex Live 2011 @ Tex Users Group) – it is actually really easy and it does not conflict with the Ubuntu Tex Live 2009 package. Below is a guide on how to install it – I got much inspiration from Quick Install Guide by the Tex Users Group.

Prerequisites
Make sure that you have got Perl installed. (Ubuntu should have this already) You can check it by opening a terminal (shortcut: “CTRL+ALT+T“) and write “man perl” which should open up the Perl Interpreter manual page (which you can quit by pressing “q“) – if there is no manual entry then you should be able to install perl by writing “sudo apt-get install perl“.

Also make sure that you have a stable internet connection and sufficient amount of available space, because you gotta download minimum 3.1 GB of Tex Live program data.

Download and installation
1. Download the installation archieve (Tex User Group Tex Live 2011 Download) and unzip it somewhere in your home folder.

2. Open a terminal (shortcut: “CTRL+ALT+T“) and navigate into the unzipped folder that starts with “install-tl” using the “cd” command.

3. Now we gotta start the installation. The default setting is to install Tex Live at the location “/usr/local/texlive” and that should not be a problem unless you have made a separate system partition (the one that contains the “/usr” folder) that is not big enough to contain minimum 3.1 GB data from Tex Live. – that was the case for me 🙁 (I use separate “/home” and “/” partitions to enable easier clean Ubuntu upgrades.)

3a) If you have plenty of space on the system partition then you can just install by writing “sudo ./install-tl”. (“sudo” has to be used because a normal user does not have permissions to change stuff in the “/usr” folder.

3b) Else you can specify the installation path of Tex Live by using the following command instead (replace “/home/USER_NAME/texlive” by what “/path/to/folder” you want, but remember “sudo” in front if you install outside of the “/home” folder): “TEXLIVE_INSTALL_PREFIX=/home/USER_NAME/texlive ./install-tl

If there are no warnings, then press “I” to start the download and installation. Now the Tex Live installation program will automatically download and install 3.1 GB of data – it will take quite a while.

Important post-installation (setup “PATH” environment variable)
Once the installation is complete, you must setup the “PATH” environment variable so the terminal knows where the Tex Live binary programs are located – e.g. when you run “latex fileName.tex” or “pdflatex fileName.tex” in the terminal then the terminal uses the “PATH” environment variable to find the “latex” and “pdflatex” programs.

Navigate using the “cd” command to the folder where you installed Tex Live. (The default folder is once again: “/usr/local/texlive“) Then continue navigating further down into the “2011/bin/” folders and finally navigate down into a folder with a platform dependent name (it is named “x86_64-linux” at my computer, but e.g. “i386-linux” on a different architectures). If you write the command “ls | grep ^pdflatex“, then it should find the “pdflatex” program and hence you have found the correct folder for the PATH environment variable.

Now write “pwd” to get the current folder path – on my computer that is “/home/USER_NAME/texlive/2011/bin/x86_64-linux“. Copy the path, lets call it “TEX_LIVE_BIN_PATH“.

Finally, you need to modify the “.profile” file (in other distributions than Ubuntu it might be “.bash_profile“) in your home directory by writing “gedit ~/.profile“. Add the following at the end of the file (replace “TEX_LIVE_BIN_PATH” by the path from the “pwd” command) and save: “PATH="TEX_LIVE_BIN_PATH:$PATH"” (The “.profile” file will be run every time you login, which will ensure that the “PATH” environment variable always contains the Tex Live path.)

Close the terminal, logout, login and now Tex Live 2011 should work.

Test
Start a new terminal (shortcut: “CTRL+ALT+T“), now if you write “echo $PATH” then the output will contain your “TEX_LIVE_BIN_PATH“-path, otherwise something went wrong in saving it in the “.profile” file (or “.bash_profile” for other than Ubuntu).

Finally, run this command to check that latex works as intended: “latex small2e” The output should start with something like “This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011)“, where the important bit is that the bracket should say (“Tex Live 2011“) and not e.g. (“Tex Live 2009“) – if the latter is the case, then either you have not setup the “PATH” environment variable correct or the Tex Live 2011 installation failed.

11 thoughts on “Install Tex Live 2011 on Ubuntu 12.04

  1. Great tutorial! I was searching for this information everywhere. Unfortunately I am a total begginer with Ubuntu, and I don’t feel very confident with some parts of the installation such as setting the right path and choosing the correct location for all files and folders. I think I could go through the first part “Downlaod and Installation” (skipping the 3b part and assuming direct typing of commands in previous parts, 1, 2 and 3). Can I do “sudo ./install-tl” directly in the location I will be when I search for “/usr/local/texlive” using “cd” command? Sorry for all the questions but I am a total begginer installing via terminal…

    Cheers from Stockholm

    • Hi Rebelde,

      Thanks for bothering to write a comment 🙂 Sorry for the late answer, studies just stole all of my time. No worries about being new with Ubuntu, we were all there at some point in the past.

      If you have installed Ubuntu using default settings (such that there is only one system partition (“/”) besides the “swap” partition) and you have got plenty (like more than 5 GB) of free space on the harddrive, then the installation is very simple.

      Lets assume that you have downloaded and unzipped the installation file “install-tl-unx.tar.gz” (from http://www.tug.org/texlive/acquire-netinstall.html) to e.g. the folder “/home/YOUR_USERNAME/install-tl-unx”

      Now all you gotta do is:
      1. Open a terminal: CTRL+ALT+T
      2. Navigate to the unzipped folder: cd install-tl-unx
      3. Navigate inside the folder hierarchy: cd install-tl-20120511
      (in the future the release file name might have changed but then you can instead just type “cd install” and then press tab to autocomplete the command.)
      4. Run the installation program with the default path on the system partition: sudo ./install
      5. Press “I” and wait for the huge download and installation to complete.

      Now we must setup the $PATH environment variable, but we need to know a foldername that is based on your computer architecture:
      6. Go to the parent folder: cd /usr/local/texlive/2011/bin/
      7. Output the directory name that we need: ls
      (mine is named “x86_64-linux” because I use 64 bit linux.)
      8. Write the following, where “x86_64-linux” is replaced by the foldername you found at step 7:
      echo PATH=\”/usr/local/texlive/2011/bin/x86_64-linux:\$PATH\” >> ~/.profile
      This will append the PATH-variable to the ~/.profile configuration file.

      You might wanna copy paste the commands to make sure than type errors does not destroy your day 🙂

      Anders, the evil neighbour Dane 🙂

  2. Thanks for the tutorial! I have to write simply PATH=”TEX_LIVE_BIN_PATH:$PATH”
    at the end of the .profile file, substituing the correct path, or I have also to write something like an instruction before it? Because I only write path=…
    but it doesn’t work. Thank you!

    Niccolò (Italy)

    • Hi Niccolò,

      Sorry I have confused you. TEX_LIVE_BIN_PATH is just an alias I use for the result of the pwd command. For my specific computer achitecture and choice of installation path, I wrote the following in the ~/.profile file:
      PATH=”/home/USER_NAME/texlive/2011/bin/x86_64-linux:$PATH”

      If you used the default install location, then you should use this instead:
      PATH=”/usr/local/texlive/2011/bin/x86_64-linux:$PATH”

      In either case, remember to change “x86_64-linux” to what the directory name is on your computer based on the architecture. Just check what the directory name is and substitute it.

      Hope this helps 🙂

      Anders (amazing so many different places we all use Ubuntu, Denmark)

  3. Thanks for great tutorial!!

    However, i’ve made one mistake: Instead of just copy/paste “PATH=”/home/USER_NAME/texlive/2011/bin/x86_64-linux:$PATH”” at the end of .profile file, i’ve made changes in wrong line (line 21):


    19 # set PATH so it includes user’s private bin if it exists
    20 if [ -d “$HOME/bin” ] ; then
    21 PATH=”/home/dominator/texlive/2011/bin/x86_64-linux:$PATH”
    22 fi
    23 PATH=”/home/dominator/texlive/2011/bin/x86_64-linux:$PATH”

    Since I haven’t saved .profile file for backup, I can’t fix incorrect line. Can you just copy/paste your line?

    Thanks in advance, cheers from Croatia 🙂

    • Ahh shit happens, here is my full .profile (Ubuntu 12.04 x64 bit).

      Greetings from UK (due to studies) / Denmark.

      # ~/.profile: executed by the command interpreter for login shells.
      # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
      # exists.
      # see /usr/share/doc/bash/examples/startup-files for examples.
      # the files are located in the bash-doc package.

      # the default umask is set in /etc/profile; for setting the umask
      # for ssh logins, install and configure the libpam-umask package.
      #umask 022

      # if running bash
      if [ -n “$BASH_VERSION” ]; then
      # include .bashrc if it exists
      if [ -f “$HOME/.bashrc” ]; then
      . “$HOME/.bashrc”
      fi
      fi

      # set PATH so it includes user’s private bin if it exists
      if [ -d “$HOME/bin” ] ; then
      PATH=”$HOME/bin:$PATH”
      fi

      PATH=”/home/USERNAME/texlive/2011/bin/x86_64-linux:$PATH”

  4. please have you tried this with a non root user? i mean we leave debian/ubuntu as is and for user that use we grant some privileges to install and use tex?
    someone could help me, because we need this feature but our “super & hiper isp” not allow us to run or use root. thanks

Leave a Reply

Your email address will not be published. Required fields are marked *