Every year when TeXLive/MacTeX updated itself, I was in an agony because the dozens of self-installed packages had to be re-installed manually. Is there a simpler, automated way to do this?

I use BasicTeX from the MacTeX website on an iMac with Mac OS X 10.9.5.


  • 2
    Possible duplicate of Why does TeX Live "require" yearly updates? – Jagath Jul 7 '16 at 3:12
  • 1
    Are the self-installed packages in your home directory, or in the system-wide TeX Live tree? – Mike Renfro Jul 7 '16 at 3:14
  • 2
    Are your self-installed packages located in the localtexmf directory? – Mico Jul 7 '16 at 4:39
  • @MikeRenfro the packages I installed are in the /usr/local/texlive/... so I think they are system wide... – George Lin Jul 7 '16 at 16:03

If you use Basic TeX, then I'm afraid the answer is Yes. Basic TeX is designed to install a minimal distribution and then all you to add any extra packages you need manually using either tlmgr from the command line or the TeXLive Utility program that comes with MacTeX. These packages are added to the main distribution tree, (/usr/local/texlive/<year>/) and are not installed in your local texmf folder (~/Library/texmf). Packages you install in your local texmf folder do not need to be reinstalled, but packages that are installed using tlmgr or TeXLive Utility do need to be reinstalled.

As mentioned in the comments, TeX Live is on a yearly update system for reasons outlined here:

So when you update a Basic TeX installation, you get a new minimal distribution for that year, just like you would get a new full distribution if you had installed the full version. Therefore any packages you added to that basic distribution will need to be reinstalled, for two reasons: first, the current year's installation has no way of "knowing" what's in another, earlier year's distribution. Second, and more importantly, packages from an earlier year may have been updated in the current year and if you used a previous year's packages you could well end up with package incompatibilities.

Unless you're really short on disk space, I would really recommend installing the full distribution, since this would save you the hassle of reinstalling missing packages manually.

  • On OS X or another Unix, one could write a shell script to handle the extra packages, with as many tlmgr install pkg1 pkg2 ... lines as required. – Mike Renfro Jul 7 '16 at 3:42
  • Thanks! But is there (a way to write) a script to record all previously installed packages before updating and re-install them in a batch if missing after the update? – George Lin Jul 7 '16 at 4:03
  • 1
    @MikeRenfro @george Yes, this would be possible. I don't know enough about tlmgr to know how to generate a list which you could use to script the installation. tlmgr info --only-installed produces such a list, so it wouldn't be so hard to then turn that into a script. But I don't know if there's a more automated way. – Alan Munn Jul 7 '16 at 4:05
  • 1
    Not having BasicTeX, all I can say is that tlmgr info --only-installed | awk '{print $2}' | sed 's/://;s/^/tlmgr install /' will return a list of tlmgr install commands, one per installed package. There may be a need to filter out some packages with grep, though. – Mike Renfro Jul 8 '16 at 3:52
  • Supposedly TL can be upgraded in-place now, so you might be able to do that. It requires some command-line usage, since TeX Live Utility actively tries to keep you from doing that (a holdover from when it didn't work), and BasicTeX installs a new tree. – Adam Maxwell Jul 9 '16 at 17:40

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.