MiKTeX

ID

miktex

Home page

https://miktex.org

Version requirement

>= 22.3

Platforms

🐧 Linux (except Windows Subsystem for Linux v1, Windows Subsystem for Linux v2) · 🪟 Windows

Operations

installed · install · upgrade · upgrade_all · remove · sync

purl types

pkg:miktex

CLI name

miktex

Issues and PRs

📦 manager: miktex

Source

meta_package_manager/managers/miktex.py

TeX package manager of the MiKTeX distribution.

Reaches MiKTeX’s own package repositories, which are distinct from the catalog tlmgr reaches for TeX Live: two distributions, two managers, rather than one wrapped twice.

Note

Linux and Windows only, and that follows the tool rather than a choice. The packages command arrived in MiKTeX 22.3, while the newest macOS build MiKTeX publishes is 22.1, which predates it. The only package surface on macOS is the standalone binary that happens to share this project’s name, which is reason enough never to reach for it.

Caution

--admin is deliberately never passed, and the reasoning inverts what its name suggests. Left alone, MiKTeX reports the packages installed for the user and those installed system-wide; the flag narrows that to the system-wide ones alone. The default is therefore already the wider listing, and passing it would drop rows rather than pin them. It is fatal outright on an installation that is not shared, and warns about privileges it may lack when run without them. The cost is that removing a system-wide package is out of reach, needing both that flag and administrator rights.

Important

Queries pass --disable-installer. MiKTeX installs packages on the fly by default, so without it reading the inventory is not guaranteed to leave the system as it found it.

Note

No outdated, though MiKTeX does have a non-mutating check: it prints bare package names and no version of any kind, where reporting something as outdated needs a version to report it against. The only route to one is asking after each package individually, thousands of invocations for a single answer. upgrade --all is unaffected.

No search, MiKTeX having no such command, and no cleanup: nothing in the package surface purges a cache or sweeps orphans.

Warning

The command that upgrades everything is update. MiKTeX’s upgrade is a different thing entirely, taking a package level such as basic or complete and erroring without one, so it is never used here.

Documentation: MiKTeX packages.

What mpm adds to miktex

mpm reaches across every manager at once, not miktex alone: mpm installed and mpm outdated cover miktex alongside every other manager you run in one table, mpm upgrade --all updates them together, and mpm sbom exports the whole machine as one bill of materials.

Every mpm command also gains --dry-run and --plan previews, cross-scheme version comparison and purl identifiers. See manager augmentations for how each one is built.

Your miktex commands, in mpm

You already know miktex: each operation maps one-to-one onto mpm, in an interface shared by every manager.

To…

With miktex

With mpm

Install a package

miktex packages install fancyhdr

mpm install pkg:miktex/fancyhdr

Upgrade one package

miktex packages update fancyhdr

mpm --miktex upgrade fancyhdr

Upgrade everything

miktex packages update

mpm --miktex upgrade --all

Remove a package

miktex packages remove fancyhdr

mpm remove pkg:miktex/fancyhdr

Prefix any command above with --dry-run to simulate the underlying manager calls without touching the system: the safe way to watch what mpm would do before trusting it.

Operations

Operation

Supported

installed

outdated

orphans

search

install

upgrade

upgrade_all

remove

sync

cleanup

doctor

Selecting and configuring miktex

Deselect miktex for a single run with --no-miktex, or persist the choice in your configuration:

[mpm]
miktex = false

Keep it enabled but tune how mpm drives it with a per-manager override:

[mpm.managers.miktex]
timeout = 900

mpm config-template miktex prints every overridable attribute as a ready-to-paste block.

Recipes

A few jobs you would otherwise script around miktex, one mpm command each:

  • Snapshot and clone a machine: mpm --miktex dump miktex.toml, then mpm restore miktex.toml on the next one.

  • Export a compliance SBOM: mpm --miktex sbom (CycloneDX by default, --spdx for SPDX).

Privilege escalation

mpm runs this manager as the current user and never prepends sudo by default. Flip the policy for its privileged operations with --sudo or the per-manager sudo override.

See privilege escalation for the full policy.

Cooldown

State of MiKTeX’s release-age gating, from the cooldown support table:

Status: ❌ None

A cooldown only pays off where a compromised release can be withdrawn while the clock runs, and can only be emulated where the registry dates its releases. From the retraction table:

Registry: Curated app stores and archives

With --cooldown set, mpm skips this manager’s install and upgrade operations rather than run them unguarded (fail-closed); --allow-unsupported-managers opts back in.

Version probe

The version is extracted from the output of miktex --version with:

r"\(MiKTeX (?P<version>\d+(?:\.\d+)*)"

Changelog

  • 7.7.0.dev0 (unreleased)

    • Add the MiKTeX TeX package manager with installed, install, upgrade, remove and sync support, shipped as a bundled definition. Its catalog listing is filtered to the inventory through a format template, MiKTeX having no installed-only listing, and queries disable its on-the-fly installer so a read leaves the system alone. It declares no outdated: MiKTeX’s update check names packages without any version to report them against.