49

If I install texlive-full on Ubuntu 12.04 using apt-get will I have the stable and checked version? or is there any security risk? should I avoid installing it?

2

5 Answers 5

60

I would like to answer this question in light of my personal experience.

  1. For many years, I have been using the default installation of LaTeX which comes with Ubuntu, and even after being an avid LaTeX user, I did not face any appreciable problem.
  2. In my home machine I am running Ubuntu 12.04 and in my office machine Ubuntu 13.04, both have LaTeX installed using the default Ubuntu installation as outlined below.
  3. When installing LaTeX, you will want to use the command, sudo apt-get install texlive. You may get tempted to use sudo apt-get install texlive-full, but this will want to install so many extra (language) packages, most which will be unnecessary for your purpose.
  4. When the above installation is complete, you will want to install the necessary language and font packages applicable to you. The commands will be in the form of sudo apt-get install texlive-lang-dutch (put your language name here. If unsure, issue command sudo apt-get install texlive-full to see which packages are selected, pick-up your necessary name(s), answer `No' to installation, and then go for installation of that particular package).
  5. You may also want to install IBus (sudo apt-get install ibus), AUCTeX (sudo apt-get install auctex), and Emacs (sudo apt-get install emacs), should you feel the need and/or inspiration to use any of these.
  6. Installing RCS (sudo apt-get install rcs rcs-latex), will help you maintain the versions of your LaTeX documents.
  7. Should you need a package in future, please use the command apt-cache search <package/style name> to find the package and then use the sudo apt-get install command to install the package. See this post for details and other options.
  8. In some rare cases, you will fail to find some package in the above method outlined in the last step. In that case, please visit CTAN, use the Search feature to locate the package, download the .zip file, unzip it (unzip <zip file name>), read the README or INSTALL file to find out any additional steps before installation, and the copy the complete folder to /usr/local/share/texmf/tex/latex/ (sudo cp -vr <folder name> /usr/local/share/texmf/tex/latex/). You may need to create the parent directories if necessary. (mkdir command). After this, run sudo texhash or sudo mktexlsr to update the ls-R databases. Without the last step, LaTeX will fail to find the package.
  9. In the above discussion, I assumed that you will want to run LaTeX from command line, like me. Should you decide to install and use any of the GUI front ends, please see this post for further instructions. I think that Emacs with AUCTeX are more that sufficient. (This setup has also been mentioned in the aforementioned post.)
  10. I understand that as indicated in the above comment from Heiko Oberdiek, you have the moderate or less than moderate (italicized part is my personal opinion) risk of using an old version. But IMHO and based on my experience over more than a decade, the risks are very minimal. But still if you want to take this route, please use the post as indicated in the comment. But unless you are a very matured Linux user (believe me, I am), I would not suggest this path. No offense intended. Setting all the $PATH and environment variables may not be what you are looking for. And occasional conflicts in dependencies may mean some extra (non-LaTeX) hassles for you.
14
  • hello MMA, this is relly a good explanation! if i had read it before... I had installed the full version and now I am wondering if some seldom used packages could bear some security issues? I just do not understand the idea of this separate package installation when all the packages can be installed with texlive-full?
    – user37025
    Sep 21, 2013 at 9:16
  • 2
    @user37025 If you install the 'Ubuntu-managed' version of TeX Live it is from the main repository. Almost all of TeX Live is TeX packages, and while there is a theoretical way to make trouble using TeX code, this is very unlikely and is deliberately prevented in the standard TeX Live settings. Note that TeX packaging and Ubuntu packaging have different approaches (Ubutnu assumes broadly a two-branch approach, while TeX packages almost all use a single release version), so even if the Ubuntu team find issues they won't get fixed in TL2009/2012, only in the latest TeX Live (currently 2013).
    – Joseph Wright
    Sep 21, 2013 at 9:40
  • 2
    The default 'security' settings of TeX Live (in terms of write permissions) are maintained in the Debian packages, so any danger (which is minimal but not non-existent --- like most other programs that can read and write files) is the same. The danger posed by LaTeX (say) is most obvious in things where you need to enable the --shell-escape option, which allows for greater 'write' permissions. But to imagine that every line of every CTAN package is personally examined by a team of experts for TeX Live and then a Debian/Ubuntu/etc. team does it again is expecting too much, I think.
    – jon
    Sep 21, 2013 at 16:24
  • 1
    I am also a very old Linux user that love the Debian package system and apt-get, but install a vanilla Tex Live is not a nigthmare and tlmgr is great also. Main problem are the dependencies of programs as LaTeX editors to the debian texlive packages, but the install page of Tex Live have an easy solution for this. So, IMHO the question is only if you are concerned to get the latest version as if your life depended on it, or this does not give a damn.
    – Fran
    Feb 27, 2014 at 18:55
  • 1
    +1 for suggesting Emacs;). However, I would not recommend RCS for version control these days; for ease of use, Mercurial is the way to go, and for power and ease of use (but only after understanding how Git works!), Git + Magit seems to be unbeatable.
    – mbork
    Feb 28, 2014 at 4:48
38

I will add a different point of view.

Two years ago when I started using Ubuntu I had quite some troubles installing all the LaTeX packages, citation styles, fonts etc (There are so many ways of doing it! See this discussion) Then, somehow I found this thread. I purged the original ubuntu-tex-live with everything else that had "tex" in it, and installed texlive-full.

Since then I've never ever had to think about installing anything related to latex. Any answer from Stackoverflow I wanted to try out just worked, any file any of my colleagues would send me flawlessly compiled (I remember spending hours getting someone else's .tex-files running, when I was on Windows). This was a miracle! And all I had to do was

sudo apt-get install texlive-full

Yes it will cost you 3GB of downloaded data and probably even more once it unpacks, but it will solve all your latex-related issues forever.

To sum this up, and to answer the original question

should I avoid installing it?

The answer is just the opposite: texlive-full is the way to install LaTeX on Ubuntu.

1
  • 4
    I appreciate the alternative point of view, however, 3GB is just way too much. That is the size of a small operating system. If every application had that kind of bloat, pretty soon your computer is out of memory. And most of the 3GB you don't need. Nov 16, 2018 at 5:03
9

For me the way to go in 2017 is to use a container like docker for installation of the latex packages. This will always give me the possibility to install the most recent versions (Because I choose which distribution to pull from) and does not disturb my system with all those latex packages.

You could easily set your system up to use the pdflatex command out of your dockercontainer so that everything will work as expected, but it will run in the docker container.

And as another big benefit: When I want to build some latex on another system: I know I have my e.g. Dockerfile that I have to use and after that everything should work as expected. No specific headaches when migrating your production environment to another location.

An example Dockerfile could look like this:

FROM ubuntu:zesty

RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
RUN apt-get upgrade -y
RUN apt-get install -y texlive-full
RUN apt-get install -y xzdec

RUN apt-get install -y wget

RUN tlmgr init-usertree

RUN tlmgr install collection-fontsrecommended collection-fontsextra libertine mweights fontaxes marvosym inconsolata newtx kastrup mathalfa was fnpct superiors translations cnltx pgfopts trimspaces csquotes pgfplots multirow tabulary rotfloat ntheorem glossaries mfirstuc xfor datatool substr tracklang cleveref mathdots marginnote biblatex logreq xstring xpatch german

RUN apt-get install -y biber

WORKDIR /data
VOLUME ["/data"]

You can use that Dockerfile with the framework shown here.

5

Agree with @MMA that 2009 will work mostly fine, but if you really want to get the 2013 use:

curl https://raw.github.com/cirosantilli/latex-cheat/master/install-texlive2013-ubuntu12.04.sh | bash

Speed up

If you want things to go way faster, first download TeX Live via torrent ISO via torrent:

wget -O /tmp/texlive2013.torrent https://www.tug.org/texlive/files/texlive2013.iso.torrent

and put it in the current directory with exact name texlive2013.iso.

It will work if you don't do this, but will be way slower (4 hours instead of 20 minutes)

Uninstall

sudo rm -rf /usr/local/texlive/2013 ~/.texlive2013

Code

At the time of the last edit, the script did:

if [ ! -f texlive2013.iso ]; then
  wget texlive2013.iso http://mirrors.linsrv.net/tex-archive/systems/texlive/Images/texlive2013.iso
fi
sudo mkdir -p /media/texlive2013
sudo mount -t iso9660 -o ro,loop,noauto texlive2013.iso /media/texlive2013
echo i | sudo /media/texlive2013/install-tl
sudo umount /media/texlive2013
sudo rmdir /media/texlive2013
# If you are done with it for good:
#rm texlive2013.iso
echo '
# Texlive
export PATH=$PATH:/usr/local/texlive/2013/bin/'"$(uname -i)"'-linux
export MANPATH=$MANPATH:/usr/local/texlive/2013/texmf-dist/doc/man
export INFOPATH=$INFOPATH:/usr/local/texlive/2013/texmf-dist/doc/info
' >> ~/.profile
source ~/.profile

Logout, and login again and you're done.

Worked today on Ubuntu 12.04, I'll try to report any errors back.

The GitHub one will be kept up to date, so just use that one.

More powerful install script

Scott is maintaining a much more advanced installation script at: https://github.com/scottkosty/install-tl-ubuntu

3
  • Of course, that's not going to work out of the box on a 64-bit system. More detail is required for people not familiar with using the command line.
    – jon
    Feb 27, 2014 at 17:40
  • @jon you mean because of the i386 part is that it? Is there a way to avoid hardcoding it? I was thinking uname, but not sure it always works. Feb 27, 2014 at 18:54
  • Hmm, I'm not sure what the best approach is; but your comment works. FYI, you can add (not indented!) at the start of your code block <!-- language: lang-sh --> + a blank line between it and the start of the code block, and you'll get 'shell' highlighting instead of *TeX highlighting. See here.
    – jon
    Feb 28, 2014 at 4:37
1

I update software regularly. I do not want to update 3-4GB of unnecessary stuff regularly... and I believe you don't want to waste time and resources on that, too.

Install system packages (for Ubuntu and its derivatives; similar package structure is used in other distros):

texlive-latex-base
texlive-latex-recommended
texlive-fonts-recommended
texlive-latex-extra (IMHO you'll use a package from here at some point, unless you're doing very basic stuff only)
texlive-bibtex-extra (if you do citations, you probably need that)
texlive-lang-(yourlang) (for any language you're writing documents in, except English)

If you know you're using pstricks, lualatex, xetex, or some specific fonts, go forth and install the respective system packages right away. If there's a specific package that your humanities/science/music/games stuff relies on, install the -humanities, -science, -music or -games package.

After that install stuff once needed. Yes, there's thousands of latex packages and fonts and stuff, but they're bundled into just a bunch of system packages (ones installed by system package manager), so you won't need to install stuff every time.

The key is to avoid installing latex packages outside of a package manager as much as possible. In 99.5% cases your latex package is already in some system package and you just need to invoke your software manager!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .