
How to Use the Command 'tlmgr install' (with Examples)
The tlmgr install command is an essential tool for managing packages in TeX Live, a distribution of TeX software. This command lets users efficiently handle the installation of TeX Live packages, ensuring their TeX system is robust and up-to-date. It streamlines package management, helping users install new packages, reinstall current ones, perform simulations to estimate changes, and manage dependencies for different purposes.
Use Case 1: Install a Package and Its Dependencies
Code:
sudo tlmgr install package
Motivation: When you need a specific functionality in TeX Live, like a particular style or tool, it’s essential to install the package related to that functionality. Using sudo tlmgr install package ensures you have the latest version with all its necessary auxiliary components. This comprehensive installation process helps avoid issues and ensures smooth operation of the installed package.
Explanation:
sudois used to execute the command with administrative privileges, which is necessary to make system-wide changes.tlmgris the TeX Live Manager, a tool used to manage TeX Live.installtells the manager to add a new package.packageis the placeholder for the package you want to install.
Example Output:
[running command: tlmgr install package]
Installing: [1/1] package
Installation of package succeeded.
Use Case 2: Reinstall a Package
Code:
sudo tlmgr install --reinstall package
Motivation: There are scenarios where a package becomes corrupted or needs updates that are not applied automatically. Reinstalling a package can resolve these issues by ensuring that the package files are restored to their latest condition in their default configuration.
Explanation:
sudogrants necessary permissions.tlmgrinvokes the TeX Live Manager.installinitiates the installation of the specified package.--reinstallis a flag that ensures the package is reinstalled, even if it is already present.packageis the package to be reinstalled.
Example Output:
[running command: tlmgr install --reinstall package]
Reinstalling: package
Installation of package succeeded.
Use Case 3: Simulate Installing a Package Without Making Any Changes
Code:
tlmgr install --dry-run package
Motivation: Before making any changes to your system, it might be wise to simulate the process, especially when dealing with dependencies and packages that could alter the TeX Live environment significantly. The --dry-run option helps predict the effects without executing them, thus avoiding unforeseen issues.
Explanation:
tlmgrstarts the TeX Live Manager.installspecifies the intent to install a particular package.--dry-runinstructs the manager to simulate the command, showing the steps that would be taken.packagerefers to the package intended for simulation.
Example Output:
[running command: tlmgr install --dry-run package]
Would install: package
Not making any changes. Simulation only.
Use Case 4: Install a Package Without Its Dependencies
Code:
sudo tlmgr install --no-depends package
Motivation: In situations where you need only a specific package and want to avoid unnecessary dependencies, especially to save space or manage the system’s complexity manually, you can opt to bypass the dependencies.
Explanation:
sudoexecutes the process with the necessary authority.tlmgris the tool in charge of managing TeX Live packages.installindicates the action to be performed.--no-dependsis a flag that ignores any dependencies of the package, installing only the selected package itself.packageis the name of the package you want to install.
Example Output:
[running command: tlmgr install --no-depends package]
Installing: package (without dependencies)
Installation completed.
Use Case 5: Install a Package from a Specific File
Code:
sudo tlmgr install --file path/to/package
Motivation: Sometimes package sources are outside the usual repository, necessitating a direct installation from a local file, either due to a custom modification or when specific non-standard packages are required that exist on a local system.
Explanation:
sudoallows the command to alter system files.tlmgris the package management tool used here.installsets the command to include a new package.--fileindicates the installation must be performed using a package file already on the system.path/to/packagespecifies the location of the package file on the local file system.
Example Output:
[running command: tlmgr install --file /Users/username/path/package.tar.xz]
Installing: package from /Users/username/path/package.tar.xz
Installation successful.
Conclusion:
The tlmgr install command offers a wide range of functionalities for efficiently managing TeX Live packages, each tailored to address specific needs. Whether installing new packages, troubleshooting issues by reinstalling, planning installations, managing dependencies, or working with local files, tlmgr install is a versatile command that can handle diverse package management requirements within the TeX Live ecosystem.

