How to use the command 'tlmgr update' (with examples)
The tlmgr update
command is an integral tool for maintaining and updating TeX Live packages. TeX Live is a comprehensive distribution of TeX software designed for users who need to prepare high-quality text and graphics. This command allows users to update packages, ensuring they have the latest features and security fixes. By providing a variety of options, tlmgr update
offers flexibility in how updates are managed, catering to different needs and preferences.
Update all TeX Live packages
Code:
sudo tlmgr update --all
Motivation: Keeping all your TeX Live packages up-to-date is crucial for maintaining security, stability, and access to the latest features. Running this command ensures that every package in your installation is updated, and is commonly the first step users take when seeking to refresh their TeX environment after a new TeX Live release or periodic updates.
Explanation:
sudo
: Necessary because the command requires administrative privileges to modify the installation.tlmgr
: Short for TeX Live Manager, a tool for managing TeX installations.update
: Command to perform updates on TeX Live packages.--all
: This option specifies that all available TeX Live packages should be updated, meaning it will iterate through the list of installed packages and apply updates wherever they are available.
Example output:
tlmgr: updating global settings
tlmgr: package repository http://mirror.ctan.org/systems/texlive/tlnet (verified)
[1/4, ??:??/??:??] update: package1 (2022.23298 < 2022.23987)
[2/4, 00:09/00:30] update: package2 (2022.17893 < 2022.17903)
[3/4, 00:11/00:36] update: package3 (2022.98765 < 2022.98876)
[4/4, 00:15/00:45] update: package4 (2022.34532 < 2022.34612)
running mktexlsr ...
done.
Update tlmgr itself
Code:
sudo tlmgr update --self
Motivation: Maintaining the TeX Live Manager (tlmgr
) itself is vital because it ensures you have the latest capabilities and bug fixes required to manage your TeX live installation effectively. This is particularly important if there have been major changes or enhancements to the manager that could impact how packages are updated or maintained.
Explanation:
sudo
: Used here to gain the necessary privileges for system-level updates.tlmgr
: The manager executing the update.update
: Performs the update action.--self
: This option focuses solely on updating thetlmgr
tool itself rather than the installed TeX packages.
Example output:
tlmgr: Local TeX Live (2019) is older than remote repository (2020).
Cross release updates are not supported. Consider upgrading instead.
Update a specific package
Code:
sudo tlmgr update package
Motivation: Sometimes updates may be needed for specific packages far more urgently than others due to bugs or new features. Selectively updating a single package allows users to receive critical fixes or enhancements pertinent to their work.
Explanation:
sudo
: Required to alter system-level software.tlmgr
: The command-line utility for managing TeX Live packages.update
: Specifies you want to update.package
: This denotes the specific name of the package you wish to update, which must be replaced with the actual package name in use.
Example output:
tlmgr: package repository http://mirror.ctan.org/systems/texlive/tlnet (verified)
[1/1, 00:10/00:10] update: package (2022.12345 < 2022.12456)
running mktexlsr ...
done.
Update all except a specific package
Code:
sudo tlmgr update --all --exclude package
Motivation: In certain situations, a particular package might have known issues with a new release, or there might be compatibility concerns with a user’s workflow or documents. Excluding a package from the update allows ensuring all other packages are current while avoiding potential disruptions with that specific package.
Explanation:
sudo
: Grants necessary permissions for package updates.tlmgr
: The package management tool.update
: Indicates the operation to perform.--all
: Ensures that the update attempts to update all packages.--exclude
: This option specifically tells the manager to omit a package from the updates.package
: The target package to exclude from updates, requiring replacement with the real package name.
Example output:
tlmgr: package repository http://mirror.ctan.org/systems/texlive/tlnet (verified)
excluded: package
[1/4, 00:09/00:35] update: package1 (2021.23456 < 2021.23987)
[2/4, 00:10/00:45] update: package2 (2020.45678 < 2020.45789)
[3/4, 00:12/00:46] update: package3 (2021.67890 < 2021.67901)
running mktexlsr ...
done.
Update all packages, making a backup of the current packages
Code:
sudo tlmgr update --all --backup
Motivation: Creating a backup before updating packages is a safeguard practice that allows you to revert your TeX installation to the previous state should the new updates cause issues or compatibility problems with your current projects.
Explanation:
sudo
: Provides essential administrative access.tlmgr
: The TeX Live package manager.update
: Indicates the operation to carry out.--all
: Determines that all packages are under consideration for updates.--backup
: Before making changes, this option creates backups of the packages, which can be restored if needed.
Example output:
tlmgr: package repository http://mirror.ctan.org/systems/texlive/tlnet (verified)
Creating backup...
[1/4, 00:08/00:30] update: package1 (2022.43456 < 2022.44567)
[2/4, 00:09/00:31] update: package2 (2022.88765 < 2022.88888)
Backup created successfully.
running mktexlsr ...
done.
Update a specific package without updating its dependencies
Code:
sudo tlmgr update --no-depends package
Motivation: Occasionally, an update to a package is desired without wanting to update or potentially affect other dependent packages, perhaps due to stability concerns. This option allows you to update just that specific package even if it has dependencies on other packages that traditionally get updated simultaneously.
Explanation:
sudo
: Needed for making changes at the system level.tlmgr
: The command-line tool for TeX Live management.update
: The action of updating packages.--no-depends
: Tells the system to avoid updating dependencies.package
: The targeted package for the update, requiring user specification.
Example output:
tlmgr: package repository http://mirror.ctan.org/systems/texlive/tlnet (verified)
Warning: --no-depends chosen, not considering dependencies for this run.
[1/1, 00:07/00:07] update: package (2022.34567 < 2022.34678)
running mktexlsr ...
done.
Simulate updating all packages without making any changes
Code:
sudo tlmgr update --all --dry-run
Motivation: A dry-run simulates the update process without carrying out any actual changes, allowing users to see what updates would be applied beforehand. This is useful for diagnosing potential problems or conflicts before committing to an update cascade.
Explanation:
sudo
: Authorizes changes, even though none will be made in this simulation.tlmgr
: The utility executing the operations.update
: The function that is being simulated.--all
: Specifies that it concerns all packages.--dry-run
: Spells out that this is a simulation and hence, no real updates are being conducted.
Example output:
tlmgr: package repository http://mirror.ctan.org/systems/texlive/tlnet (verified)
Dry-run mode -- no changes will be made.
[1/4] will update: package1 (2022.43456 < 2022.44567)
[2/4] will update: package2 (2022.78765 < 2022.79887)
Steps logged, simulation complete, no changes made.
Conclusion
The tlmgr update
command in TeX Live is a versatile and potent utility allowing users to manage their TeX environments efficiently and flexibly. Different options enable broad community and specific-user needs, ranging from bulk updates to tailored safeguarding strategies by excluding known problematic updates or running simulated trials. Understanding these options empowers users to maintain both the integrity and performance of their installations.