Skip to content

Instantly share code, notes, and snippets.

@laracarbajal
Forked from yig/update_mactex.md
Created March 20, 2025 06:19
Show Gist options
  • Select an option

  • Save laracarbajal/78adf04475979ce22ede86f26ced6731 to your computer and use it in GitHub Desktop.

Select an option

Save laracarbajal/78adf04475979ce22ede86f26ced6731 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
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment