tlmgr-backup
Backup TeX Live packages
TLDR
Make a backup of one or more packages
Make a backup of all packages
Make a backup to a custom directory
Remove a backup of one or more packages
Remove all backups
SYNOPSIS
tlmgr backup [options] [pkg...]
tlmgr backup --all
tlmgr backup --list
tlmgr backup --delete N | --clean N
PARAMETERS
--all
Backs up all currently installed TeX Live packages that are eligible for backup.
[pkg...]
Specifies one or more individual package names to back up. If no packages are specified and `--all` is not used, `tlmgr` will usually prompt or do nothing.
--list
Lists all currently available backups, showing package names and their stored versions.
--delete N, --clean N
Deletes backups that are older than N days. This helps manage disk space consumed by backups.
--dry-run, --no-execute
Performs a trial run without making any actual changes. It shows what would happen if the command were executed.
--no-checksums
Disables the calculation of checksums for the backed-up files. This can speed up the backup process but reduces integrity verification.
--quiet
Suppresses most output messages, useful for scripting.
DESCRIPTION
`tlmgr backup` is a subcommand of the TeX Live Manager (tlmgr) utility designed to create and manage backups of installed TeX Live packages. This functionality is crucial for maintaining the stability of a TeX Live installation, as it allows users to revert to previous versions of packages in case an update introduces regressions or issues.
When executed, `tlmgr backup` stores older versions of package files, typically within a `.tlpkg/backup` directory inside the TeX Live installation tree. It can be used to back up specific packages, all installed packages, or to manage existing backups by listing or deleting them. While `tlmgr backup` is solely responsible for creating and maintaining these archives, the actual process of reverting to a backed-up version is handled by the `tlmgr restore` command or the `--rollback` option of `tlmgr update`.
The ability to create backups provides a safety net for users, ensuring that even after performing updates, a working configuration can be restored if necessary.
CAVEATS
- Backups consume significant disk space, especially when backing up many packages or using the `--all` option frequently.
- `tlmgr-backup` only archives TeX Live package files; it does not back up user-specific configuration files, custom installed fonts, or documents.
- The restoration process is handled by separate commands (`tlmgr restore` or `tlmgr update --rollback`), not `tlmgr backup` itself.
BACKUP STORAGE
By default, `tlmgr` stores backups in a `.tlpkg/backup` subdirectory located within the root of your TeX Live installation. Each backed-up package version typically resides in its own compressed archive or directory within this structure.
AUTOMATIC BACKUPS
TeX Live can be configured to automatically create backups during `tlmgr update` and `tlmgr install` operations. This behavior is controlled by the `autobackup` option, which can be enabled or disabled using `tlmgr option autobackup <0|1>`.
RESTORATION WORKFLOW
It is crucial to understand that `tlmgr backup` merely creates the backup files. To revert to a previous version of a package, you must use `tlmgr restore
HISTORY
`tlmgr` (TeX Live Manager) was introduced in TeX Live 2008 as a comprehensive replacement for older management tools like `texconfig-sys` and `pkgtool`. The `backup` subcommand was an integral part of this new system, providing essential rollback capabilities for package updates and installations. Its introduction significantly improved the stability and maintainability of TeX Live installations by offering a reliable mechanism to revert to previous working states, especially as online updates became the standard.