Skip to content

Instantly share code, notes, and snippets.

@yig
Created August 9, 2018 21:23
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yig/ffc9627ee90299a3a077e35cda18325c to your computer and use it in GitHub Desktop.
Save yig/ffc9627ee90299a3a077e35cda18325c to your computer and use it in GitHub Desktop.
Instructions for updating MacTeX's BasicTeX every year

Once you get the dreaded error message that tlmgr won't install any new packages, it's time to upgrade to the latest texlive.

  1. Save list of currently installed packages:

     tlmgr list --only-installed > previously_installed_texlive_packages.txt
    
  2. Download and install the latest BasicTex.pkg: http://www.tug.org/mactex/

  3. Save list of default packages:

     tlmgr list --only-installed > default_installed_texlive_packages.txt
    
  4. Install any recent updates:

     tlmgr update --self
     tlmgr update --all
    
  5. Install previously installed packages either by cherry-picking from "previously_installed_texlive_packages.txt" (comparing to last year's "default_installed_texlive_packages.txt") or automatically:

     cat previously_installed_texlive_packages.txt | while read LINE; do
         PACKAGE=$(echo $LINE | cut -d " " -f 2 | cut -d ":" -f 1);
         tlmgr install $PACKAGE;
     done
    
  6. Delete the old texlive by removing the year from:

     /usr/local/texlive
    
@VitoVan
Copy link

VitoVan commented Mar 30, 2024

Thank you! This saved my hour.

@VitoVan
Copy link

VitoVan commented Mar 30, 2024

If one wants to only install the not-yet-installed packages in the new version, comm could be helpful:

comm -23 <(sort previously_installed_texlive_packages.txt) <(sort current_installed_texlive_packages.txt) > not-found.txt

source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment