I have installed Texlive 2010 on Ubuntu 10.10 from .iso image. now I want to upgrade my pgf. After following these steps, I receive this error:

! I can't find file `pgfmathfunctions.code.tex'.
l.16 \input pgfmathfunctions.code.tex
(Press Enter to retry, or Control-D to exit)

I searched that file and found it in pgf's directories. When I copy it beside of my tex file, another error is occurred: the program is unable to find another file; that exists in pgf directories...

Note: I do sudo texhash after replacing new directories.

  • It seems that tex is not able to find your files. Where exactly are your pgf directories? Which exact instructions did you follow? The question you linked to has two answers, one of them is Windows (actually, MikTeX) specific, the other one in my opinion lacks many details, and, again in my opinion, mistakenly advises to install new version in the regular texmf tree rather than a local texmf tree. Nov 20, 2010 at 17:29
  • there are in /usr/local/texlive/2010/texmf-dist/tex/generic/pgf, /usr/local/texlive/2010/texmf-dist/tex/latex/pgf, and etc. so where should I copy new files?
    – sorush-r
    Nov 20, 2010 at 17:38
  • ... and what is local texmftree?
    – sorush-r
    Nov 20, 2010 at 17:39
  • I a typical TeX distribution, all tex and realted (e.g. metafont, I believe that's where the mf comes from) files are kept in several directory trees. There is the main texmf tree (on linux /usr/share/texmf) which contains all the tex files that were installed by your package manager (that would be apt-get or synaptic on ubuntu, texlive's own package manager on some other systems). You should not change anything there manually, since all your changes are going to be overwritten next time the file you change gets automatically updated. Nov 20, 2010 at 18:28
  • Continuing previous comment: all user installed file should go either into the local texmf tree (on ubuntu it will be /usr/local/share/texmf) or your personal tree (~/texmf). Nov 20, 2010 at 18:33

1 Answer 1


Not a direct answer to your question, but the current archive of TeX Live 2010 actually contains pgf/tikz v2.10. So

 sudo tlmgr update --all

will (amongst others) download tikz v.2.10 and install it.

EDIT: I think I know what is going on: You have both TeX Live 2009 from the Ubuntu archive and TeX Live 2010 installed. For your normal user $PATH is set such that TL2010 is seen, but for root path doesn't point to the TL2010 installation. So whenever you call sudo texhash it will actually use the TL2009 texhash, which of course causes problems.

  • I don't have a working tlmgr :-(
    – sorush-r
    Nov 20, 2010 at 18:49
  • What happens when you try to run tlmgr? That may be related to your texhash problem. Nov 20, 2010 at 19:10
  • sudo tlmgr update --all gives sudo: tlmgr: command not found but bash knows tlmgr without sudo before it, but it doesn't work (tlmgr update --all gives tlmgr: package repository /media/Documents/Programs/TeX/tex/texlive2010-20100826 You don't have permission to change the installation in any way, specifically, the directory /usr/local/texlive/2010/tlpkg/ is not writable. Please run this program as administrator, or contact your local admin.).
    – sorush-r
    Nov 20, 2010 at 19:14
  • try sudo /usr/local/texlive/2010/bin/i386-linux/tlmgr update --all or sudo /usr/local/texlive/2010/bin/x86_64-linux/tlmgr update --self (depending on which architecture you have installed.
    – Caramdir
    Nov 20, 2010 at 19:20
  • It's now updating....
    – sorush-r
    Nov 20, 2010 at 19:25

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.