Friday, July 2, 2010

Updating TeX Live on Mint

Linux Mint is built on Canonical's Ubuntu distribution, and Canonical is, shall we say, a tad conservative about updating packages in their repositories.  Thus Ubuntu 9.10 (Karmic Koala), which I believe was released in the fall of 2009, still had the 2007 version of the TeX Live distribution of LaTeX. (The recently released Ubuntu 10.04 Lucid Lynx distribution apparently comes with TeX Live 2009; meanwhile, TeX Live 2010 is out and about.)

For various reasons, it became incumbent upon me to update my laptop (Mint Helena, built on Karmic Koala) to a later version of TeX Live.  So I zapped the old installation and followed the quick install instructions, including the comment that they recommend installing as a normal user rather than as root.  This made sense, since when TeX Live is installed as root you have to sudo to do some maintenance operations, such as updating the file name database.

Yeah, except ... if TeX Live is installed as root, it can write anywhere, so it gets itself on the system command path effortlessly and automatically.  Not so if it's installed in user mode.  I had to point it to a different folder than where it normally installed (I picked a folder under /opt -- which I then had to sudo to create) and got it installed, but it was not on the system command path.  So now I had to add the location of the new TeX Live bin directory to the system command path.

Rarely do I pay Windows a compliment, but it's pretty darned easy to add something to the Windows path (maybe too easy, from a security perspective), and it's equally easy to distinguish between the overall path (that every user gets) and the supplemental path that only the user making the changes gets.  Not so with Linux.  As best I can tell, there are no helper tools to make path changes in Linux.  So I added the path to my ~/.bashrc file (where I've made other path changes in the past), and that seemed to work ... until I tried to use my favorite document writing program, LyX.  Started from a terminal (where I was logged in as myself), it required a reconfiguration (which came as no huge shock), after which it ran fine. Started from the Mint program menu, though, it insisted that all document classes had gone missing, which is a sure sign that it can't find the LaTeX distribution.

Mind you, if I started LyX from a terminal with sudo (so that it was running under the root account), I could get it to work. But no way would it run from the menu. So I guess the ~/.bashrc file is not read by programs run from the menu. Fine, be that way.  I eventually solved the problem by appending the path export to /etc/profile, the system-wide profile. It works -- now -- but if some system upgrade down the road rewrites that file, I hope I remember to look here for how to get LyX working again. :-(

No comments:

Post a Comment

Due to intermittent spamming, comments are being moderated. If this is your first time commenting on the blog, please read the Ground Rules for Comments. In particular, if you want to ask an operations research-related question not relevant to this post, consider asking it on Operations Research Stack Exchange.