49

I'm reading this, where one of the respondents says to "get a package from CTAN". There are no installation instructions in the package mentioned.

I've installed texlive-full and use the long-term support version of Ubuntu precisely so I won't have to deal with this stuff, so everything will "just work".

Is there a command I can run from the terminal, like ctan-install or latex-install, that will find the packages I need, update them, etc.?

(sudo apt-get upgrade doesn't show that texlive-full needs updating.)

update: Thank you for the help, everyone. I think this is going to work (eventually). However as I keep downloading iso's, the synaptic package for texlive-full, and install-tl, my hard drive is now close to full with all of these TeX libraries! What should I delete after this is all over, and how? (I tried to remove the texlive-full meta-package in Synaptic and it said it would remove teXmacs as well.) Also: how am I ever going to keep this up to date and working with other programs I may install in the future?

  • 3
    Have you tried tlmgr update --all? tlmgr is the TeX Live manager and would download & install packages (from a default or given repository) from the command line. – Werner Sep 09 '11 at 19:58
  • @Werner: tlmgr doesn't work with the TeXLive package of the repository. – Marco Daniel Sep 09 '11 at 20:00
  • 4
    This is related to the long-standing issue that Ubuntu uses an old version of TeX Live for 'stability', and so you are much better off installing TeX Live directly from TUG so that you can use tlmgr for installations. (The TL team sort out sorting out CTAN packages - it's not as simple as 'download and put in the right place'.) – Joseph Wright Sep 09 '11 at 20:46
  • @Werner sudo apt-get install tlmgr nor apropos tlmgr didn't find anything. – isomorphismes Sep 09 '11 at 22:16
  • 2
    @Joseph: sadly, I don't think stability is the reason really, rather that packaging TeXLive as deb packages is a huge mess nobody wants to do once a year... – raphink Sep 09 '11 at 23:16
  • 2
    @laotzu if you're going to use recent packages, I'd really recommend you drop the packaged version of TeXLive and install it with install-tl. – raphink Sep 09 '11 at 23:17
  • @Raphink How do I drop the packaged version and install it with install-tl? – isomorphismes Sep 10 '11 at 00:42
  • @Joseph Wright How do I get tlmgr? – isomorphismes Sep 10 '11 at 00:47
  • 1
    See also http://tex.stackexchange.com/questions/26154/getting-texlive-installation-to-work –  Sep 10 '11 at 06:10
  • 2
    @laotzu: Follow the instructions over at http://www.tug.org/texlive/quickinstall.html – raphink Sep 10 '11 at 06:37

4 Answers4

26

Another solution is to download TeX Live 2011 from here. After having installed it, and having performed the post-installation step, you can then use tlmgr to list the packages that are available for download or have been updated as follows:

sudo -i tlmgr update --list

You can also use the following command, for example, to get all the packages available for download/update:

sudo -i tlmgr update --all

To select a particular package for download/update, type the following command:

sudo -i tlmgr update <package-name>

This requires you to know the name of the package you want to download/update.

Alternatively, you may run the tlmgr in GUI mode by typing the following command:

sudo -i tlmgr --gui

This will allow you to select the packages that you want to install/update/remove.

Note that, in order to run tlmgr in GUI mode, you will need to install perl-tk.

P.S. Yes, I am using Ubuntu, and have not had a problem thus far....

P.P.S. The post installation step requires that you add the path to your TeXLive 2011 binaries in $PATH. To do this for all users, create a file called zzz-texlive.sh in /etc/profile.d/:

export PATH=/usr/local/texlive/2010/bin/`uname -i`-linux:$PATH
export MANPATH=/usr/local/texlive/2010/texmf/doc/man:$MANPATH
export INFOPATH=/usr/local/texlive/2010/texmf/doc/info:$INFOPATH
unset TEXINPUTS
unset TEXMFCONFIG

Note that you will have to be logged in as root to do this. If you can't log in as root, create the file using the following command:

sudo vi zzz-texlive.sh

vi is a text editor that will allow you to create the file. You may, however, use other editors if vi is not your thing. Once you set up the paths correctly, and reboot your system, you can then run tlmgr as indicated above.

Note that the above post-installation solution was proposed by @Herbert here.

Bill
  • 1,181
  • 1
    I installed Tex Live 2011 from the .iso but I still don't have tlmgr. – isomorphismes Sep 10 '11 at 18:49
  • @Lao - tlmgr should come with TeXLive 2011. Have you set the paths correctly, as part of the post installation step? FYI - I will modify my answer to include this. – Bill Sep 10 '11 at 21:49
  • I think so. The post-installation step was to append PATH=/usr/x/y/z/:$path and more to the end of ~/.bashrc, right? – isomorphismes Sep 10 '11 at 22:01
  • Yes, that is right. Try typing 'which tlmgr' at the system prompt. What does that give you? – Bill Sep 10 '11 at 22:04
  • BTW - You also need to capitalize $path (i.e. $PATH). – Bill Sep 10 '11 at 22:06
  • which tlmgr returns nothing. Thanks for the $PATH advice -- looking at ~/.bashrc I guess I had already done it that way. – isomorphismes Sep 10 '11 at 22:19
  • OK, it seems like tlmgr is not installed. As a sanity check, though, cd to your root directory and type the following command at the system prompt: find . -name "tlmgr" -print

    This will tell you for certain whether or not tlmgr is installed.

    – Bill Sep 10 '11 at 22:31
  • Now that I've added that /etc/profile.d/zzz-texlive.sh I get the following message on starting a new bash window: bash: export: /downloads/sage-4.7.1-linux-32bit-ubuntu_10.04_lts-i686-Linux/:/home/bill/dev/:/usr/local/texlive/2011/bin/x86_64-linux/:/usr/local/texlive/2010/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games=/usr/share/fslint/fslint/:/downloads/sage-4.7.1-linux-32bit-ubuntu_10.04_lts-i686-Linux/:/home/bill/dev/:/usr/local/texlive/2011/bin/x86_64-linux/:/usr/local/texlive/2010/bin/x86_64-linux:/usr/local/sbin:....': not a valid identifier – isomorphismes Sep 10 '11 at 22:34
  • find found ./usr/local/texlive/2011/bin/i386-linux/tlmgr – isomorphismes Sep 10 '11 at 22:39
  • So, it is installed! This is the path that you need to put in your zzz-texlive.sh file. As for the message that you are getting, in the zzz-texlive.sh script, change 'uname -i' for i386. This should solve your problem. – Bill Sep 10 '11 at 22:46
  • Bill, thank you for your continued efforts. The first line of /etc/profile.d/zzz-texlive.sh now reads export PATH=/usr/local/texlive/2011/bin/i386-linux:$PATH but I am getting bash: export: /downloads/sage-4.7.1...-Linux/...:/usr/local/texlive/2011/bin/x86_64-linux/:/usr/local/texlive/2010/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games=/usr/share/fslint/fslint/:/downloads/sage-4.7.1...-Linux/:/home/.../dev/:/usr/local/texlive/2011/bin/x86_64-linux/:.../usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games': not a valid identifier – isomorphismes Sep 10 '11 at 23:41
  • @Lao - Did you reboot your system after you made the change? That might solve your problem. Otherwise, you may refer this problem to Ask Ubuntu. – Bill Sep 11 '11 at 00:10
  • Bill, thanks for your help. The problem was that, amidst all of these different advice pages, I had edited ~/.bashrc and /etc/bash.bashrc and /etc/profile.d/zzz-texlive.sh . The user ~/.bashrc ended in this: http://pastie.org/2516101 and when I deleted that appendage the problem went away. – isomorphismes Sep 11 '11 at 01:32
  • I'm glad you were able to solve the problem. I hope that tlmgr is working for you now. – Bill Sep 11 '11 at 01:54
9

You can simply download it using wget, but this is off topic:

wget http://mirror.ctan.org/<package path+packagename.zip>

This command saves the package in the current working folder. You can change the target with

wget -O $HOME/Download http://mirror.ctan.org/<package path+packagename.zip>

Once downloaded, you can unpack the archive .zip with unzip.

Now you must copy the package (files) in a search path of TeXLive. I recommend a local folder. You can find the local folder with:

kpsexpand '$TEXMFHOME'

Normally it is saved in:

/home/<user>/texmf

Note: TEXMFHOME, like all trees, must be organized according to the TDS, or files may not be found. For details see: TexLive Directories

Lastly: Sometimes it is necessary to call mktexlsr to update TeX's filename database (FNDB).

Werner
  • 603,163
Marco Daniel
  • 95,681
  • 3
    But this just downloads the entire package (as a packed .zip). Could you add some detail about unpacking it in either the local directory, or migrating it to your distribution folder (and running texhash)? – Werner Sep 09 '11 at 20:03
  • Ah. I didn't know kpsexpand. I had found the word texmf in /usr/share/texmf/ so I was putting LyX / Sweave stuff in there (that's what started this whole multi-day installation process: trying to get Sweave to work). Did I maybe cause a problem by putting files there? – isomorphismes Sep 09 '11 at 22:21
  • @LaoTzu: Private files should always been locate in the home directory. You can install such programs in /usr. For details see: Filesystem Hierarchy Standard. With the command kpsexpand '$TEXMFHOME' you didn't find the folder `/usr/share/texmf/ definitely. But I think you should ask such question on AskUbuntu – Marco Daniel Sep 09 '11 at 22:31
  • Right, I hadn't heard of kpsexpand until today. I was just looking around in the file system. I probably did ls -R / | grep texmf. I've looked at that Wikipedia article before and it doesn't make sense to me. Yes, this question is kind of a hybrid between (3) fora. Are TeX libraries "private"? – isomorphismes Sep 10 '11 at 00:44
  • @LaoTzu: If the package author provided a TDS ZIP file then it should be under http://www.ctan.org/tex-archive/install/macros/latex/contrib/<name>.tds.zip. Simply unzip it over your TEXMF tree. – Martin Scharrer Sep 10 '11 at 06:40
  • @Martin Scharrer How do I unzip it over my TEXMF tree? – isomorphismes Sep 10 '11 at 22:44
  • @LaoTzu: You simply use an unzip software and choose as target the base directory of your TEXMF folder. I would use your local per-user TEXMF folder which is normally under ~/texmf for Linux/Unix OSs. Try the mentioned kpsexpand '$TEXMFHOME' command to find it on your installation. – Martin Scharrer Sep 10 '11 at 23:17
1

I think that, contrary to the blog instructions I found, it would have been easier to do a net-install of texlive as per http://www.tug.org/texlive/acquire-netinstall.html, rather than torrenting an iso, mounting the iso, and more instructions after that.

There seem to be fewer commands to run and fewer ways to get lost with the net-install.

Once the installation is finished, TeX Live will prompt you to edit ~/.bashrc, mutatis mutandi. Do that, then run mktexlsr and/or texhash. (I'm not sure what either command really does, but they seem to be important—and running them doesn't seem to muck anything up.)

Finally, you will have the CTAN command-line package management program tlmgr. This page lists several commands you should run with tlmgr, such as updating self and updating all.

If things go amiss, try reinstalling or updating packages with tlmgr and running texhash again.

-1
  1. wget http://mirror.ctan.org/package-path+packagename.zip
  2. unzip packagename.zip
  3. mkdir /usr/share/texlive/texmf-dist/tex/latex/packagename
  4. sudo cp /path/to/packagename/packagename.sty /usr/share/texlive/texmf-dist/tex/latex/packagename
  5. sudo mktexlsr
  6. Be happy.

Tested on Ubuntu.