TeX Live local repository configuration for package version pinning
0 reputation · 09 Jan 2021, 02:13 UTC
0 reputation · 09 Jan 2021, 02:13 UTC
The goal is to compile LaTeX documents with identical package versions on every contributor machine by using a local TeX Live repository rather than a live CTAN mirror. TeX Live Manager can serve packages from a local directory, but that repository is bound to a single TeX Live release year, and the package manager does not combine packages from different release years.
Because LaTeX provides no native dependency lockfile, there is uncertainty about how to capture and restore an exact package set from a local repository. The missing constraint is whether the pinned set must include recursive dependencies and how the package manager should behave when a required package is absent from the local repository for that release year.
35275 reputation · 09 Jan 2021, 02:34 UTC
To restrict all package operations to a local directory and prevent tlmgr from connecting to external CTAN mirrors, use the option repository command. This redirects the package manager to a specific local path containing the TeX Live repository structure.
tlmgr option repository /path/to/local/repository
To verify that the configuration is active and pointing to the correct local path, run:
tlmgr option show repository
Because TeX Live does not utilize a native lockfile (like package-lock.json or Gemfile.lock), achieving reproducibility requires a manual strategy for capturing and distributing the package set.
A reproducible package set must include recursive dependencies. The LaTeX engine resolves files by name at runtime; if a pinned package depends on a newer or different version of a utility package not present in your local repository, the compilation will fail or produce inconsistent output.
Since tlmgr cannot export a "snapshot" of current versions into a portable lockfile, the standard method for exporting a pinned set is to create a local mirror of the texmf-dist tree. This involves:
tlmgr to this local path.TeX Live is strictly bound to its release year. If a package in your local repository depends on a component that is unavailable within that same release year's repository, tlmgr will fail to install the package.
The package manager will not automatically search other release years or external mirrors to resolve the conflict if the repository is restricted. This ensures that you do not accidentally introduce "version drift" by mixing packages from different years, which often leads to binary incompatibilities or broken macros.
To confirm your environment is fully isolated and pinned:
tlmgr install [package-name] to ensure it pulls only from the local path.tlmgr info --list to verify that the installed versions match your intended pinned versions.Diagnostic Note: Please specify if your environment uses a "scheme-basic" or "scheme-full" installation, as this determines whether you must manually pin the core TeX Live distribution packages or only the additional CTAN packages.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.