MiKTeX from the Command line (Windows/macOS/Linux)
See also How should one maintain and update a MiKTeX installation?
The command line tool for MiKTeX package manager is called mpm
. It can be used as:
mpm [option...]
The MiKTeX website has this description for the tool mpm
.
MPM (MiKTeX Package Manager) is used to install packages from a MiKTeX
package repository.
MPM was originally intended to be a tool for MiKTeX users. But the
program can be helpful for users of other TeX systems too, because
many of the MiKTeX packages are system-independent. Two variants
The package manager can be run in two modes:
batch
--MPM is driven by command-line options.
windowed
--MPM shows a package list view with standard GUI controls (such as tool bar buttons and command menus).
MPM starts in windowed mode, if you do not specify any command-line
options.
In 'windowed mode' the tool starts the GUI interface.
Following are the command line options respected by mpm
.
--admin
Run in administrative mode.
--find-updates
Test the package repository for updates, then print the list of updateable packages.
--help
Give help and exit.
--hhelp
This option is only available on Windows systems: show the manual page in an HTML Help window and exit when the window is closed.
--import=PACKAGE
Import the specified package from another MiKTeX installation. The root directory must be specified via --repository=DIR
.
--import-all
Import all packages from another MiKTeX installation. The root directory must be specified via --repository=DIR
.
--install=package
Install the specified package.
--install-some=file
Install packages listed (line-by-line) in the specified file.
--list
List the contents of the package database: for each package, print the installation status, the number of files, the size, and the name.
--list-repositories
Download the list of known package repository URLs from the MiKTeX project server, then print the list.
--pick-repository-url
Pick up a suitable URL from the package repository list and print it.
--print-package-info=package
Print detailed information about the specified package.
--quiet
Suppress all output, except errors.
--repository=location
Use the specified location as the package repository. The location can be either a fully qualified path name (a local package repository) or an URL (a remote package repository). You can use the --list-repositories
to retrieve a list of working package repository URLs.
--set-repository=location
This option is only available on Windows systems: permanently register the location of the default package repository in the user area of the Windows Registry. The location can be either a fully qualified path name (a local package repository) or an URL (a remote package repository).
--trace[=tracestreams]
Enable trace messages. The tracestreams argument, if speciefied, is a comma-separated list of trace stream names (Chapter 9, Trace Streams).
--uninstall=package
Uninstall the specified package.
--update=[package]
Update the specified package, if an updated version is available in the package repository. Update all installed packages, if package is omitted.
--update-db
Synchronize the local package database with the package repository.
--update-some=file
Update packages listed (line-by-line) in the specified file.
--verify
Verify the integrity of all installed packages.
--verify=package
Verify the integrity of the specified package.
--verbose
Turn on verbose output mode.
--version
Show version information and exit.
Installation Destination:
All files are installed in the TEXMF installation directory (usually C:\Program Files\MiKTeX 2.9). It may be necessary to specify the location of the installation directory, if you are running MPM as a standalone program, i.e., if MiKTeX is not the TeX system.
The --install-root
option allows you to set the installation directory for one invocation of MPM.
Package Database:
All package information is retrieved from the package database, which must have been properly installed by running MPM with the --update-db
option.
Examples
Print the list of known package repository URLs:
mpm --list-repositories
Retrieve the package database files from the FTP server some.server:
mpm --repository=ftp://some.server/miktex/packages/ \ --verbose --update-db
Print information about package a0poster:
mpm --print-package-info a0poster
Install package a0poster:
mpm --verbose --install a0poster
Update all installed packages:
mpm --verbose --update
Print the list of installed packages:
mpm --list | grep ^i
Reference: MiKTeX page for mpm