LinuxCommandLibrary

tlmgr-restore

Restore TeX Live installation from a backup

TLDR

List all available backup revisions for all packages

$ tlmgr restore
copy

List all available backup revisions for a specific package
$ tlmgr restore [package]
copy

Restore a specific revision of a specific package
$ tlmgr restore [package] [revision]
copy

Restore the latest revision of all backed-up packages
$ tlmgr restore --all
copy

Restore a package from a custom backup directory
$ tlmgr restore [package] [revision] --backupdir [path/to/backup_directory]
copy

Perform a dry-run and print all taken actions without making them
$ tlmgr restore --dry-run [package] [revision]
copy

SYNOPSIS

tlmgr restore <backup_id> [--verify]
tlmgr restore --list
tlmgr restore --delete <backup_id>
tlmgr restore --delete-all

PARAMETERS

<backup_id>
    Specifies the unique identifier of the backup to be restored or deleted. This ID is typically a timestamp in the format YYYY-MM-DD-HH-MM.

--list
    Lists all available backups, displaying their unique IDs, creation dates, and sizes. This helps in identifying the correct backup to use.

--delete <backup_id>
    Deletes the specified backup from the backup storage directory. This frees up disk space.

--delete-all
    Deletes all existing backups. This action is irreversible and should be used with extreme caution.

--verify
    When used with a <backup_id>, this option performs an integrity check on the specified backup before proceeding with the restore operation, ensuring the backup is not corrupted.

DESCRIPTION

The tlmgr-restore command, typically invoked as a subcommand of tlmgr (TeX Live Manager), is used to revert a TeX Live installation to a previously saved state. This powerful recovery tool relies on backups that were created using the tlmgr-backup command. Its primary purpose is to recover from accidental deletions, corrupted installations, or to simply roll back to a known stable configuration prior to a problematic update or change.

When executed, tlmgr-restore meticulously replaces the current files of your TeX Live distribution with the contents of the specified backup archive. It's a highly destructive operation, as it directly overwrites existing files. Therefore, careful selection of the correct backup ID and a thorough understanding of the implications are paramount before proceeding. Beyond restoration, the command also provides convenient functionalities to list all available backups and to delete specific or all unwanted backups, assisting in managing storage space and maintaining an organized recovery strategy.

CAVEATS

Restoring a TeX Live installation is a destructive operation that overwrites existing files. Always ensure you have selected the correct backup ID.
This command only restores files managed by TeX Live's package system; it does not manage user-specific configuration files or manually added files outside of the TeX Live package structure.
Backups must have been created by tlmgr-backup. Restoring an older state might revert crucial security updates or bug fixes present in newer versions of packages.

BACKUP LOCATION

By default, TeX Live backups created by tlmgr-backup are stored in a dedicated directory within your TeX Live installation. This location is typically found under the TEXMFVAR tree, often at $TEXMFVAR/backup. Each backup is usually stored as a compressed archive (e.g., a zip file), with its filename corresponding to the backup's timestamp ID.

RESTORATION SCOPE

The tlmgr-restore operation primarily focuses on restoring the state of the TeX Live installation's core files and packages. It ensures that the files managed by tlmgr itself are reverted to their state at the time the backup was created. It does not typically affect system-wide configurations outside the TeX Live tree, user-specific configurations in home directories (e.g., ~/.texmf-var), or other custom modifications not directly handled by tlmgr's package management.

HISTORY

The tlmgr (TeX Live Manager) suite, which encompasses the essential backup and restore functionalities, was developed to significantly enhance the management of the comprehensive TeX Live distribution. Prior to tlmgr's widespread adoption (beginning with TeX Live 2008 and improved in subsequent releases), managing TeX Live installations and updates was often a more manual and error-prone process. The introduction of tlmgr provided a robust, centralized package management system, offering features like dependency resolution, seamless package installation, and the critical ability to create and restore system backups for disaster recovery and version rollback, ensuring greater stability and ease of maintenance for TeX Live users.

SEE ALSO

tlmgr(1), tlmgr-backup(1), tex(1)

Copied to clipboard