How to use the package manager on Unix-like operating systems

Wednesday, 10 August 2005 21:38 by CSchenk

MPM (MiKTeX Package Manager) was originally intended to be a tool for MiKTeX/Windows users.  But the program can be helpful for users of other TeX systems too, because many of the MiKTeX packages are system-independent.

Installing the package database

First of all you should install the package database files on your computer. To do this, run

> sudo mpm --update-db

This command retrieves the package database files from a remote package repository and installs them in the installation directory.

To list the contents of the just installed package database, run

> mpm --list

To get datailed information about a package, run

> mpm --print-package-info=PACKAGE

Setting the installation directory

The installation directory is the root of a TDS-compliant TEXMF directectory hierarchy. The location of the installation directory is determined by the configure script.

The --install-root option lets you set the installation directory at run-time. For example, the following command installs the package database files in your home TEXMF:

> sudo mpm --install-root=~/texmf --update-db

Installing and updating packages

Use the --install option to install a package. For example, run

> sudo mpm --install=a0poster

to install the a0poster package.

The --update option can be used to update installed packages. Run

> sudo mpm --update

to update all installed packages. Run

> sudo mpm --update=PACKAGE

to update a certain package.

 

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Related posts

Comments

March 8. 2006 01:15

John Wohlbier

Add a comment that MIKTEK_INSTALLROOT should be set so that
one doesn't have to use --install-root for each command.

John Wohlbier

May 22. 2006 23:39

Jonathan Underwood

Hello Christian,

This looks like interesting work. I have a question for you:

Most linux distributions have a package management system (eg. rpm) for the entire system, and usually the tetex distribution is installed as a package. As far as I can work out, mpm will short circuit the system package manager by updating components of the texmf tree, overwriting the files installed as part of the tetex package, or adding files which don't get registered with the system package manager.

Of course, the massive advantage of mpm is the fine grained management of individual latex packages, but I wonder if there's a way to integrate it with the system package manager, somehow.

Thoughts?

Jonathan Underwood

May 23. 2006 22:03

MPM will install new packages in the local TeXMF tree, i.e., it will not get into the way of the system package manager. The local TeXMF tree is traditionally reserved for local user additions.

CSchenk

June 30. 2006 11:58

Luca Cerone

I think it would be useful a GUI for MikTex Tolls in Linux, like the one tha is used under Win. I also have a problem: though some packages result as "already installed" I can't compile my document because they are not recognized... What should I do???

Luca Cerone

July 19. 2006 16:35

ahmet nurlu

Great!,

I was a user of miktex in Windows . When I switched to Linux(apperently to TeTeX for Latex), ı was shocked that there is no a package manager for TeTeX. Now I am a happy TeTeX user because of a miktex package manager.

Thanking you Christian Schenk

Ahmet Nurlu

ahmet nurlu

August 9. 2006 03:17

Anthony Tate

Is there a way to use MPM under linux from behind a proxy server which requires authentification.

Anthony Tate

August 9. 2006 14:56

hamaryns

It would be very nice if there was a method to find out which package file x.y belongs to. The FAQ explains it under Windows, but this is unusable with mpm on Linux.

hamaryns

September 7. 2006 02:13

Chris

Where might I find an installer (rpm, ebuild, ...) for MikTeX MPM for my linux (Gentoo, SuSe, RH)?

Thanks for the article.

Chris

September 13. 2006 18:48

Andreas Hirsch

As ahmet nurlu stated in his posting:

Great!,

I was a user of miktex in Windows . When I switched to Linux(apperently to TeTeX for Latex), ı was shocked that there is no a package manager for TeTeX. Now I am a happy TeTeX user because of a miktex package manager.

Thanking you Christian Schenk

Same for me! In addition, I was shocked that the Packages in TeTeX are very old and out of date. Without the package-manager I had no chance to start texing under Linux!

Thank you for this piece of software!

Mayby some day you will give as a tool to install a lot of packages on the fly Wink

(e.g. I'm now installing about 20 pst-xxxx packages)

Andreas


Andreas Hirsch

September 14. 2006 07:19

Martin

Hi,

what I somehow miss using the mpm, is the possibility, that one user downloads packages which have updated versions into a global directory. Then all other users do not need to download those packages again, but install from that global directory. This helps for larger (Windows sites) to keep all users at the same version level. Is this not supported by mpm, or did I just not read the mpm docs carefully enough?

Kind regards, Martin.

Martin

September 17. 2006 05:48

teTeX is no more aintained! Its author suggest people to switch to TeX Live. TeX Live and MikTeX Package manager might be very powerful combination.

Juhapekka Tolvanen

September 18. 2006 20:59

kim

yes, as chris said, an installer or a detailed description of how to install would be nice...

kim

September 20. 2006 05:59

Peter-Jan

Two questions:

1) After running,

sudo mpm --update-db

I get the following message after a while,

mpm: Connection timed out

Maybe this has something to do with the proxy server... ??


2) How can I force mpm to look only at the repository located at:

ftp.sun.ac.za

Must I edit etc/apt/source.list perhaps?

Peter-Jan

September 28. 2006 06:15

Sander Oom

This is a solution to a long standing problem.

Another thread on the topic can be found here:
www.codecomments.com/...ive384-2005-11-704828.html

This is how I tried to get it to work:

1. Get source for "MikTex Tools for *nix" from: http://www.miktex.org/unx/
MPM is the only bit in "MikTex Tools for *nix".

Install from source, as 'su' of course, using the following commands:
# tar xvzf package.tar.gz
# cd package
# ./configure
# make
# make install

The make command lead to errors due to dependencies, which were partly solved after installing (using Yast) 'libidn-devel' and creating a link from 'libcurl.so' to 'libcurl.so.3' (version installed on OpenSuse 10.0). Then more errors appeared and I gave up.

Anybody having more luck or skill or both?

Cheers,

Sander

Sander Oom

November 25. 2006 08:09

Now that TeTeX is no longer supported, mpm offers a good alternative to get an up-to-date TeX system installed without having to resort to a CD, as is the case for TeXLive. Once mpm installed and initialised, one can simply do

mpm --install=ltxbase

and voilà, a working TeX system is present!

Of course, one probably wants to install some more packages as well...

hamaryns

November 29. 2006 01:03

hamaryns

Hm, I obviously was a bit over-enthousiastic. It does not install the necessary binaries. One still needs a tex installation providing the programs too. Pity.

hamaryns

December 3. 2006 01:35

troyme

I think it should have a config file so that I needn't to type the config option every time when I want to install a package

troyme

December 15. 2006 16:27

Peter

Thanks!

After losing the mainboard on my winxp laptop, I hurriedly had to set up a new LaTeX system on a spare Linux box I had laying around. The Linux system already had a TeTex setup, so it was less than 10 minutes' work to download and build mpm and install the half-dozen or so packages I needed to keep working. Thanks so much for this incredibly convenient piece of software!

Peter

December 28. 2006 17:04

Rupp

There seems to be a proxy option when looking throught the source code and a comment giove an "experimental" status .

is it possible to use this command line ( e.g : mpm -proxy host:port ) to specify a proxy because neither the Environment variables nor creating any confuig file will work .

Best Regards

Martin RUPP

Rupp

January 5. 2007 03:19

Rick

Nice work!

But why is proxy environment setting ignored?

$ mpm --trace --list-repositories
core: initializing MiKTeX core library version 2.5.2395
core: operating system: Linux 2.6.17-10-generic #2 SMP Tue Dec 5 22:28:26 UTC 2006 i686
core: program file: /usr/bin/mpm
libmpm: initializing MPM library version 2.5.2392
core: The MiKTeX function Unknown fails for the following reason:
Connection refused
Info:
Source: mpm.cpp
Line: 1237
core: uninitializing core library
mpm: Connection refused

Hope this helps to find the bug.

regards

Rick

March 12. 2007 22:52

Alex Hamann

Could anybody tell me what files and directories mpm will install in the specific install location? The reason for my question is that I installed mpm in one location, however noticed later that another location would be more appropriate. Both work but I want to get rid of the earlier installation and optimize my system.
TIA

Alex Hamann

March 16. 2007 21:44

Matti

Thank you very much! I got mpm working in ubuntu edgy with texlive and I am very happy! There is also a howto for installing mpm in Ubuntu: help.ubuntu.com/community/MiktexPackageManager

Tip for beginners: run "sudo mktexlsr" after installing packages in order them to work.

Matti

March 21. 2007 18:10

Dan

Don't forget to run texhash after installing a package! (When using teTeX on linux).

www.tex.ac.uk/.../texfaq2html?label=instpackages


Dan

April 19. 2007 17:47

Guillaume

I find it rather sad that mpm is not compatible with localisations.

Guillaume

May 24. 2007 07:33

Mircea

I have the following problem: I'm running ubuntu 7.04 (feisty) and texlive on a dual-boot machine with winxp (I don't know if that makes a difference). I had already installed Miktex in winxp, so I just made a symlink to the texmf folder and used that as my "local" texmf. When I try to update the packages, everything works fine except if the package includes a "README" file. Then mpm gives an error, for example:

mpm: File exists: /usr/local/share/texmf/doc/generic/hyph-spanish/README

it then marks the package as "not installed", and exits. I tried everything I knew, but couldn't figure out what's wrong. Any ideas?

Thanks...

Mircea

August 29. 2007 02:20

Sebastian

mpm is great but too often it shows unknown package even if I am sure that package is in that repository. now i try to instal plpsfonts and cannot do that Frown
and second thing - is it possibly to implement somehow downloading "on-the fly" packaged when needed during compilation?

Sebastian

August 29. 2007 19:55

What makes you think that plpsfonts is a known MiKTeX package?

The "on-the-fly" install feature requires some modifications to the KPathSea library, which is a part of TeX live. This is not on my todo list. If you want that feature, you should contact the TeX live folks.

CSchenk

August 31. 2007 01:18

Sebastian

kpathsea is also in tetex. on Windows i compiled one beamer example and TeXniC center downloaded on the fly plpsfonts.cab package so I assume it is known MikteX Package.

Sebastian

August 31. 2007 08:34

teTeX is dead. If you want to implement the "auto-install" feature, then you have to do it in TeX live.

Check your typing: plpsfont <> plpsfonts. plpsfont is a package name. plpsfonts is not.

CSchenk

September 2. 2007 00:25

Sebastian

Ok, but it was easier for me to install teteX than TL.
Will we see in repositories some XeteX packages like som Mac fonts or maybe XeteX itself?


Sebastian

February 29. 2008 10:30

MikTeX often packs multiple style files together in one package. This means that if you want to install, e.g. suffix.sty,
mpm --install=suffix
will not work, since it does not know the package suffix. To find out in which package it is included, you can grep for it in the directory tpm/packages which it has created by doing mpm --update-db:
grep -l suffix.sty /tpm/packages/*
will show you
bigfoot.tpm
so that now you can do
mpm --install=bigfoot
and latex will no longer complain about suffix.sty! (Of course, after texhash)

HTH, H.

hamaryns

March 13. 2008 05:04

WhiteG

I previously reported a problem with mpm (from miktex-2.7.2960) on Fedora 8. Today I built mpm on a Fedora 8 system that has several updates from the testing repository and mpm works fine, so I expect the issue will be fixed on Fedora 8 with some future update.


WhiteG

June 27. 2008 22:40

Sebastian

On OpenSuse 10.3 its a problem compiling MPM after that trying to run mpm i received message:
mpm: error while loading shared libraries: libMiKTeX207-packagemanager.so.1: cannot open shared object file: No such file or directory

Sebastian

August 21. 2008 12:37

Jason

I had the same problem, until I remembered to run ldconfig after compiling.

Jason

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

October 8. 2008 11:52