How to Update TeX Live packages (with examples)
TeX Live is a popular distribution of the TeX typesetting system, used for typesetting documents in mathematics, engineering, science, and other fields. The tlmgr update
command is used to update TeX Live packages to their latest versions.
Use case 1: Update all TeX Live packages
Code:
sudo tlmgr update --all
Motivation: Updating all TeX Live packages ensures that you have the latest features, bug fixes, and security patches for all the installed packages.
Explanation: --all
is used to update all packages in the TeX Live distribution.
Example output:
tlmgr: package repository (http://mirror.ctan.org/systems/texlive/tlnet) seems to be updatable: TeX Live 2021
tlmgr: no updates available
Use case 2: Update tlmgr itself
Code:
sudo tlmgr update --self
Motivation: Keeping tlmgr itself up to date ensures that you have the latest version with bug fixes and new features.
Explanation: --self
is used to update tlmgr itself.
Example output:
tlmgr: package repository (http://mirror.ctan.org/systems/texlive/tlnet) seems to be updatable: TeX Live 2021
[1/1, ??:??/??:??] update: texlive.infra [3294k] (57252 -> 57934) ... done
tlmgr: package log updated: /usr/local/texlive/2021/texmf-var/web2c/tlmgr.log
Use case 3: Update a specific package
Code:
sudo tlmgr update package
Motivation: Updating a specific package allows you to update only the package you need, without updating other packages unnecessarily.
Explanation: package
is the name of the specific package you want to update.
Example output:
tlmgr: package repository (http://mirror.ctan.org/systems/texlive/tlnet) seems to be updatable: TeX Live 2021
[1/1, ??:??/??:??] update: package [1234k] (123 -> 456) ... done
tlmgr: package log updated: /usr/local/texlive/2021/texmf-var/web2c/tlmgr.log
Use case 4: Update all except a specific package
Code:
sudo tlmgr update --all --exclude package
Motivation: Excluding a specific package allows you to update all packages except for the one you specify, which can be useful if you want to avoid updating a package that is known to cause compatibility issues with your current setup.
Explanation: --exclude package
is used to exclude the specified package from being updated.
Example output:
tlmgr: package repository (http://mirror.ctan.org/systems/texlive/tlnet) seems to be updatable: TeX Live 2021
[1/1, ??:??/??:??] update: package1 [1234k] (123 -> 456) ... done
[1/2, ??:??/??:??] update: package2 [5678k] (789 -> 012) ... done
\tlmgr: package log updated: /usr/local/texlive/2021/texmf-var/web2c/tlmgr.log
Use case 5: Update all packages, making a backup of the current packages
Code:
sudo tlmgr update --all --backup
Motivation: Creating a backup of the current packages before updating ensures that you can revert to the previous versions if the updated packages cause any issues.
Explanation: --backup
is used to create a backup of the current packages.
Example output:
tlmgr: package repository (http://mirror.ctan.org/systems/texlive/tlnet) seems to be updatable: TeX Live 2021
[1/1, ??:??/??:??] update: package1 [1234k] (123 -> 456) ... done (backup created: /usr/local/texlive/2021/tlpkg/backups/package1-123.tlpkg)
[1/2, ??:??/??:??] update: package2 [5678k] (789 -> 012) ... done (backup created: /usr/local/texlive/2021/tlpkg/backups/package2-789.tlpkg)
tlmgr: package log updated: /usr/local/texlive/2021/texmf-var/web2c/tlmgr.log
Use case 6: Update a specific package without updating its dependencies
Code:
sudo tlmgr update --no-depends package
Motivation: Some packages have dependencies on other packages, and updating them may also update their dependencies. By using --no-depends
, you can update a specific package without updating its dependencies.
Explanation: --no-depends
is used to update a package without updating its dependencies.
Example output:
tlmgr: package repository (http://mirror.ctan.org/systems/texlive/tlnet) seems to be updatable: TeX Live 2021
[1/1, ??:??/??:??] update: package [1234k] (123 -> 456) ... done
\tlmgr: package log updated: /usr/local/texlive/2021/texmf-var/web2c/tlmgr.log
Use case 7: Simulate updating all packages without making any changes
Code:
sudo tlmgr update --all --dry-run
Motivation: Running a dry run before actually updating packages allows you to see what changes would be made without actually making any modifications to your TeX Live installation.
Explanation: --dry-run
is used to simulate the update process without actually updating any packages.
Example output:
tlmgr: package repository (http://mirror.ctan.org/systems/texlive/tlnet) seems to be updatable: TeX Live 2021
[1/1, ??:??/??:??, ?.???, ????] update: package1 [1234k] (123 -> 456) ... done
[1/2, ??:??/??:??, ?.???, ????] update: package2 [5678k] (789 -> 012) ... done
tlmgr: package log updated: /usr/local/texlive/2021/texmf-var/web2c/tlmgr.log
Conclusion:
The tlmgr update
command is a powerful tool for updating TeX Live packages. Whether you need to update all packages, update a specific package, exclude a package from the update, or perform other advanced update operations, tlmgr update
provides the flexibility to meet your needs. By using the different options available with tlmgr update
, you can ensure that your TeX Live installation is up to date and benefit from the latest features, bug fixes, and security patches.