I don't know how to install new packages. I've tried to install texLive [I have installed sudo apt-get install texlive-full -- which went correct, but I can not install Tex Live], but after install TeX Live dosent'respond. I write tlmgr, and I get response 'no comand 'tlmgr' ' I have read documentation, but now I am confused even more.


  1. how to install TeX Live on bash [correctly]

  2. Say I want to install packages: xcoffins.sty

    • what kind of file download from CTAN?
    • where put them?
    • how to make them work with TeXstudio?
  3. How to keep TeX Live updating new packages

How to do this Step-by-Step.

I feel like I have tried absolutly every way, but not the correct one.

  • 3
    See: support.rstudio.org/help/kb/faq/… – Marco Daniel Aug 12 '12 at 16:39
  • 4
    Take a look at tex.stackexchange.com/questions/1092/…. Broadly, if you install the 'managed' TeX system, there is no tlmgr and you get what Ubuntu provides. On the other hand, you can install TeX Live yourself 'outside' of the system manager, then do your own thing. – Joseph Wright Aug 12 '12 at 16:42
  • Marco Daniel I have instaled newest version of TeX Live. What now? – Daniel Miliński Aug 12 '12 at 18:51
  • 1
    Now that you installed TeX Live, you have the tlmgr tool. Run tlmgr option repository http://mirror.ctan.org/systems/texlive/tlnet on a terminal to change the repository and then run tlmgr update --self --all to update tlmgr itself and your installation; you need to run this last command when you want to update your installation. Here you can find a tutorial on tlmgr. To install packages which are not included in the TeX Live distribution, see tex.stackexchange.com/q/1137/3954. – Gonzalo Medina Aug 12 '12 at 21:47
  • liveTex is in a newest version. But I can not run tlmgr. What is wrong? or How to do that? – Daniel Miliński Aug 12 '12 at 23:39

actually this is a further comment on corentin's answer, but it exceeds 600 characters.

Since http://www.tug.org/texlive/devsrc/Master/texmf-dist/tex/latex/ is an Apache directory listing you can try downloading packages with wget. For example if you want to download l3experimental where xcoffins is a subfolder you can invoke wget like

wget --cut-dir=4 -np -R "index.html*" -nH -P ~/texmf -r http://www.tug.org/texlive/devsrc/Master/texmf-dist/tex/latex/l3experimental/


wget --cut-dir=6 -np -R "index.html*" -P ~/texmf/tex/latex -r http://www.tug.org/texlive/devsrc/Master/texmf-dist/tex/latex/l3experimental/


  • -P ~/dir/in/home/directory/ specifies the local directory where wget should put your files.
  • -nH tells wget that you don't want to create directories named after the host i.e. ~/texmf/www.tug.org/*/*/ looks not so nice and latex won't find anything under ~/texmf/www.tug.org. But you can omit -nH and change the local directory to -P ~/textmf/tex/latex. Then you have a seperate directory tree that latex also searches.
  • whereby --cut-dir=x means that you don't want to create the first x folders of the uri in your local directory (you want to create ~/texmf/tex/latex/l3experimental/ or ~/texmf/tex/latex/www.tug.org/l3experimental/ instead of ~/textmf/texlive/devsrc/Master/texmf-dist/tex/latex/l3experimental).
  • -R instructs wget to exclude all files beginning with index.html.
  • -r is for recursive fetch
  • the argument of -P is the directory where you want to save all those things
  • -np excludes all parent directories of l3experimental (of course you can find a more detailed description in the manual pages of wget)

but generally be careful if you download things with wget recursively it could mess up a whole directory tree. I would recommend you to first download the files in a temporary directory (for example with -P ~/texmftemporary) where you can examine the downloaded directory tree.

Since latex also searches recursively for packages in ~/texmf/tex/latex you don't have to bother if xcoffins is a subfolder of any other folder/folders.

Of course you can redefine things further if you write a little bash, perl or whatever script that is based on the above command.

Maybe this helps you!?


It is my understanding that you tried to install the official TeXLive packages through Ubuntu repositories by running sudo apt-get install texlive-full in Ubuntu 12.04 but hit a wall at some point. The links provided by @JosephWright is a good start. The answers and links there were what helped me when I had the same problem with TexLive in Ubuntu 12.04 two months ago.

I don't know if the TeXLive in the Ubuntu repositories is now updated to 2012. Last time I checked (2 months ago) it was still TeXlive 2009. So if you have already installed TeXLive by running sudo apt-get install texlive-full you may want to uninstall it again by running sudo apt-get remove texlive-full in your terminal then follow the online installation procedure here.

  • Specifically, you download install-tl-unx.tar.gz and extract to your desired folder, say at ~/Downloads.

  • In your terminal type cd to the extracted folder and run sudo perl install-tl. Type I to install. You may accept default values. The installer will then download and install TeXLive from the nearest ctan mirror near you. Take note of your installation path.

  • After the download has finished, run gedit ~/.profile or alternatively, open your file browser and go to home, hit ctrl+h and run .profile. At the end of the file, write the path to your texmf directory. For 32-bit computers, the default is:

PATH=/usr/local/texlive/2012/bin/i386-linux:$PATH; export PATH

MANPATH=/usr/local/texlive/2012/texmf/doc/man:$MANPATH; export MANPATH

INFOPATH=/usr/local/texlive/2012/texmf/doc/info:$INFOPATH; export INFOPATH

For 64-bit computers, the default is:

PATH=/usr/local/texlive/2012/bin/x86_64-linux:$PATH; export PATH

MANPATH=/usr/local/texlive/2012/texmf/doc/man:$MANPATH; export MANPATH

INFOPATH=/usr/local/texlive/2012/texmf/doc/info:$INFOPATH; export INFOPATH

Again, check the location of your texmf carefully to avoid problems later on. Save the file and close it. To check if your installation is successful, run tex in your terminal. It should show something like:

This is TeX, Version 3.1415926 (TeX Live 2012)

If it doesn't work, try rebooting.

To install texstudio, run the following commands:

sudo add-apt-repository ppa:blahota/texstudio

sudo apt-get update

sudo apt-get install texstudio --ignore-depends=texlive

The --ignore-depends option will cause dpkg to ignore the dependency check.

After installation, you may have to configure texstudio but if there is no problem with the installation, it should work fine.

If all went well, you will find that xcoffins.sty is also installed in your tex directory. Also, you can now update using tlmgr. And texstudio will also work out just fine.

  • With sudo apt-get install texstudio --ignore-depends=texlive you intended to replace apt-get install with dpkg -i, because the ignore-depends` options seams only available for dpkg. And texstudio is now part of the official repo, no need for add-apt repository anymore – Murmel Sep 17 '16 at 14:48

First, see if TeXLive is installed: does the latex and pdflatex commands works?

If so, to install new packages:

If the downloaded package contains the .sty file, use it, if not run latex <package>.ins or latex package.dtx to generate the .sty file.

Then put the package.sty file in the /usr/share/texmf/tex/latex/ directory, and run sudo texhash command to update TeXLive

  • 4
    I would not recommend to put files in directories otherwise maintained by the package manager. Instead i suggest to put the package related files in your own texmf tree. You can get the root path of this tree by invoking kpsewhich --var-value=TEXMFHOME. Of course you can change TEXMFHOME to whatever you like. – user1146332 Aug 12 '12 at 18:06
  • Ok -- I have a TeXLive. How to downlad the files using bash, Corentin? What kind of files -- there are lots of them? In my question there was an exapmle. Example plese [xcoffins.sty] – Daniel Miliński Aug 12 '12 at 18:47
  • How to get automatic update? – Daniel Miliński Aug 12 '12 at 18:51
  • 3
    With the Ubuntu TL, there are no updates. Better to go for the TUG TL i stedet as mentioned else where. It does not provide automatic update, but it does provide an updater which one can run when ready. Automatic updates are not a good idea regarding LaTeX, as an update may end up breaking your document an hour before you need to hand it in. – daleif Aug 13 '12 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.