Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I don't use MiKTeX or any other package managers. I usually install new styles/libraries by adding the .sty file to the same directory as the .tex file and compile using pdflatex.

I figured out I have pgf version 2.0 and want to upgrade to version 2.10. I already tried doing texhash, but that didn't seem to change anything.

Can someone help me out? I don't wish to install any MiKTex-like software.

share|improve this question
Take a look at the question on upgrading TikZ: tex.stackexchange.com/q/2044/86 (as TikZ and PGF come bundled together). Do any of the answers there help you? (I would think that Jan's answer is the place to start). If not, please edit your question to explain what difficulties you are having. –  Loop Space Mar 24 '11 at 21:05
add comment

2 Answers

up vote 2 down vote accepted

The solution to replace the /usr/share/texmf folder contents will certainly work -- but only so long until the package manager updates you TeX distribution.

The preferred way to install a local copy of a huge package like pgf 2.10 would be to install it either into your local texmf tree (which should have a higher priority when TeX actually searches for files) or you could also set the TEXINPUTS variable accordingly. The first approach is certainly the standard approach, but it may require to re-structure the directory representation of pgf 2.10 (pgf2.10/generic/pgf --> ~/texmf/tex/generic/pgf, pgf2.10/latex/pgf --> ~/texmf/tex/latex/pgf should already be enough for a LaTeX distribution).

The second approach would mean to unzip pgf 2.10 anywhere on your hard drive (for example the directory into which you would have copied .sty files for simple packages) and set TEXINPUTS=<my dir to pgf 2.10//: before compiling with this particular version. Note that // means "search in this directory and all its sub-directories" and the trailing : means "now continue searching in the default search paths" (don't forget this trailing :!). There are reasons why this might be a bad idea (slower due to lacking search index, also searches in pgf/doc/**, to say two obvious choices), but I like it because setting an environment variable is so light-weight and usually works much better than the other alternatives.

Note that even if you would use MikTeX, you could still install pgf in any directory of your choice (providing you apply the TDS restructuring as indicated above): you would then simply tell MikTeX "ah, and by the way: use my custom directory with higher priority than the system's default". But since you do not appear to use MikTeX, I won't go into the details.

share|improve this answer
add comment

The solution was to manually delete all files referring to the old version of pgf in the /usr/share/texmf folder. Then I manually copied all the files under the /tex directory in pgf_2.10.tds into the corresponding /usr/share/texmf folder. Then I ran texhash multiple times.

In the end, the library that I wanted to add worked, and compilation worked, and the result looks good.


share|improve this answer
you should mark your own answer as accepted one to prevent it hanging in the "unanswered" list. –  Dmitrii F. Volosnykh Apr 22 '11 at 3:13
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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