How to use the command 'tlmgr install' (with examples)
This article provides examples of different use cases for the command ’tlmgr install’ which is used to install TeX Live packages.
Use case 1: Install a package and its dependencies
Code:
sudo tlmgr install package
Motivation: The motivation for using this example is when you want to install a package along with its dependencies. This ensures that all the necessary components are installed to successfully use the package.
Explanation: ‘sudo’ is used to run the command with superuser privileges. ’tlmgr install’ is the command followed by the name of the package to be installed.
Example output:
tlmgr: package 'package' not present in package repository.
Use case 2: Reinstall a package
Code:
sudo tlmgr install --reinstall package
Motivation: The motivation for using this example is when you want to reinstall a specific package. This is useful if you suspect that the package was not installed correctly or if you want to update it to the latest version.
Explanation: ‘sudo’ is used to run the command with superuser privileges. ’tlmgr install’ is the command followed by the ‘–reinstall’ flag and the name of the package to be reinstalled.
Example output:
tlmgr: package 'package' not present in package repository.
Use case 3: Simulate installing a package without making any changes
Code:
tlmgr install --dry-run package
Motivation: The motivation for using this example is when you want to see what changes will be made if a package is installed, without actually making any changes. This can help in understanding the impact of the installation before proceeding with it.
Explanation: ’tlmgr install’ is the command followed by the ‘–dry-run’ flag and the name of the package to be analyzed.
Example output:
installation size: 7 k
tlmgr: package 'package' not present in package repository.
Use case 4: Install a package without its dependencies
Code:
sudo tlmgr install --no-depends package
Motivation: The motivation for using this example is when you want to install a package without its dependencies. This can be useful in situations where you already have the required dependencies installed separately and want to avoid redundancy.
Explanation: ‘sudo’ is used to run the command with superuser privileges. ’tlmgr install’ is the command followed by the ‘–no-depends’ flag and the name of the package to be installed.
Example output:
tlmgr: package 'package' not present in package repository.
Use case 5: Install a package from a specific file
Code:
sudo tlmgr install --file path/to/package
Motivation: The motivation for using this example is when you want to install a package from a specific file. This can be useful when you have a local copy of a package file and want to install it manually.
Explanation: ‘sudo’ is used to run the command with superuser privileges. ’tlmgr install’ is the command followed by the ‘–file’ flag and the path to the package file to be installed.
Example output:
tlmgr: package 'package' not present in package repository.
Conclusion:
The ’tlmgr install’ command is a versatile tool for installing TeX Live packages. With the provided examples, you can install packages with their dependencies, reinstall packages, simulate installation without making any actual changes, install packages without their dependencies, and even install packages from specific files. Use these examples to enhance your TeX Live package management workflow.