Can I download CTAN packages from the command-line? (Ubuntu)
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.
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).