The MiKTeX Package Manager 2.7 on Ubuntu Linux 8.04 LTS (Hardy Heron)

The MiKTeX Package Manager (mpm) is a tool originally intended for MiKTeX users on Windows platforms. It was ported by Christian Schenk for unix systems, to provide easy access to the MiKTeX package repository also for unix user. There are some docs describing installation and use, some are obsolete now, that’s why I will give a summary how I’ve installed the mpm on the latest Ubuntu Linux version today.

The mpm sources can be downloaded from http://miktex.org/unx.

Important: have a look at the README.unx file! Below are the commands I applied during installation.

Installation of some required packages in addition to the basic setup:
$ sudo apt-get install g++ cmake libcurl3 libcurl4-gnutls-dev lynx

Decompress the archive, change into the created directory, run cmake to produce customized makefiles (I added options to use texmf in my home directory) , run make to compile and to install:
$ tar xfj miktex-2.7.2960.tar.bz2
$ cd miktex-2.7.2960/
$ cmake -G "Unix Makefiles" -DMIKTEX_INSTALLROOT="/home/stefan/texmf" -DMIKTEX_ROOTS="/home/stefan/texmf"
$ make
$ sudo make install

The MiKTeX Package Manager installation is complete. Create the file name database files:
$ sudo ldconfig
$ sudo initexmf -u
$ sudo mpm --update-db

Finally the mpm is ready to use.

Links:

01. July 2008 by stefan
Categories: Uncategorized | 31 comments

Comments (31)

  1. Instead of make install it could be a good idea to use the checkinstall tool.

  2. Pingback: ElectroSizzle.com » Ubuntu 8.04, SUN Java6 JDK, TexLive, Eclipse 3.4 and Texlipse

  3. Does it work the same way with Ubuntu 7.10 too? I have problems with the “make” step.

  4. I was using the mpm 2.5 on Ubuntu 7.04 and 7.10, I’ve described the installation here, perhaps there’s already some useful information for you.
    Of course I have to say consider to update to at least 8.04.

  5. Pingback: KOMA-Script 3 available - TeXblog - Typography with TeX and LaTeX

  6. sudo apt-get install libqt4-dev

  7. Thank you for your recipe. I am new to Linux and I wanted to use the mpm as I was used to under winxp.

    And I am almost done …

    There is just one thing, the mpm installs packages under:
    /home/user/miktex-texmf
    And I can’t get texlive to make use of this folder, nor to change the folder within mpm into e.g. /home/texmf

    What can I do, that I can use the packages?

    Any help welcome.

  8. Hi Maik,

    check your setting of the environment variable $TEXMFHOME:
    kpsewhich -var-value=TEXMFHOME

    in the terminal/ shell.

    You could change the setting for instance with the bash shell by export:
    export TEXMFHOME='/home/user/miktex-texmf'

    To make it persistant add this line for example to your ~/.bashrc or ~/.bash_profile.

    Stefan

  9. Thank you Stefan!!!

    that did the trick.
    Btw. somehow the directory of MPM changed by itself to “/usr/local/share/miktex-texmf”

    Anyhow the MPM is working fine and so I always have most up to date latex pkgs.

    Maik

  10. Hi Stefan!

    Thanks to your tutorial I’ve just managed to compile miktex 2.8 beta 2 on ubuntu 8.10. However, like Maik, I’m having troubles getting the downloaded packages to work with texlive. Unfortunately your suggestion to him doesn’t seem to work for me. $TEXMFHOME points at the directory where the new packages are stored, but after a ‘sudo texhash’ pdflatex still complains about a missing .sty file even though a locate command shows that it is in fact in the miktex-texmf structure. Any obvious step that I’m missing? In any case, thanks so much for taking the time to document your installation steps here.. cheers!

  11. Hi koen,

    have a look at your texmf.cnf file, you can find it by locate or kpsewhich. Read the comments inside, they could be helpful in order to adjust the TeX variables. Without to look at your system directly it’s hard to guess the reason. I’m not using the mpm now, I’ve installed TeX Live that’s coming with its own package manager tlmgr, perhaps this could be an option for you too.

    Stefan

  12. Thanks for your quick response!

    TeX Live 2008 (and 2009) sure do look good with the package manager! I found your post about getting it to run outside apt, which I might give a try later.. but I’m a bit scared of messing up my LaTeX system on my main computer while writing my thesis :)

    Anyhow, I got everything to work with texhash after a very simple ‘mv /home/user/miktex-texmf /home/user/texmf’ and changing the ownership from root to myself. But a whole new world opened up with the config files.. good to know where all those variables are defined. Hope I can ignore it for a little bit and concentrate on the content of my tex documents again.. thanks for your help!

  13. Hi Stefan,
    I am having some similar problems, but none of your advises did work at all. My TEXMFHOME variable is set to $HOME/miktex-texmf and I installed a new package there. This, however, does not work. Kile only compiles the test file if I copy the files stored in $HOME/miktex-texmf to my /usr/share/texmf directory. I also had a short look on my texmf.cnf, but it wasn’t very helpful. Any idea what might go wrong? I would appreciate any help!
    Thanks,
    Sören

  14. Hi,
    after some more hours of trial and error i set up the variable at logon in the file ~/.profile.
    I don’t know why, but that worked fine with kile. Apparently, kile only loads the variable TEXMFHOME once at the start.
    By the way, I found that in another forum thread and the tipp was by you :-)
    Thanks a million!
    Sören

  15. Hi Sören,

    I’m glad that it helped!

    Stefan

  16. Hi!

    Thanks for the howto!
    On Ubuntu 9.10 Karmic I had to install the following packages before the compilation:
    #sudo apt-get install bison flex libqt4-dev
    Then I made a
    #sudo checkinstall
    and it is working now.

    Regards.

  17. Hallo Stefan,

    erst einmal vielen Dank für die Mühe, die Du Dir hier gemacht hast. Eventuell kannst Du mir helfen: Beim Versuch Deiner Anleitung folgend erhalte ich bereits beim ersten Befehl die Meldung “Konnte Datei libcur13 nicht finden”. Ich benutze ein Xubuntu 9.10 und betrachte mich als absoluten Linux-Neuling. Xubuntu läuft seit einer guten Woche erst auf meinem Rechner…

    Christoph

  18. Hallo Christoph,

    es muss libcurl3 statt libcur13 heißen, es ist ein kleiner Buchstabe l statt der Ziffer 1.

    Viele Grüße,

    Stefan

  19. Hi Stefan,

    hab gerade Deine Anleitung probiert, bin aber leider gescheitert. Fehlermeldung:

    CMake Error: The source directory “/home/user/Downloads/miktex-tools-2.8.3541-1-i386-linux” does not appear to contain CMakeLists.txt.
    Specify –help for usage, or press the help button on the CMake GUI.

    Hast Du eine Idee, was ich falsch gemacht habe? Das Packet hab ich von der Seite die oben auch verlinkt ist geladen.

    Viele Grüße,
    Luc

  20. Just in case that anyone get to the same problem as I had.

    When I was running the cmake command I got the error message:

    “Qt4 is required unless you enable the NO_GUI option.”

    Try to read the CMakeList.txt and search for NO_GUI. Change the value there to “TRUE” to switch off the gui I’ve never seen. =)

    Regards.

  21. Hi m0zi,

    thank you for this information!

    Stefan

  22. Hello Stefan. Thank you very much for this post. I’ve got my mpm working, the thing is that I needed a package called moderncv, I installed it but Kile doesn’t seem to recognize it. I get errors like “missing begin{document}” and “Undefined control sequence: mobile”, although it is defined within the moderncv class… do you know where I can get help? Thanks a lot!

  23. Hi Oscar,

    does your problem still exist? Did you call
    sudo texhash

    after installation? Perhaps check out http://tug.ctan.org/tex-archive/macros/latex/contrib/moderncv if your installation is complete.

    Stefan

  24. Hallo Stefan,

    wie entfernt man MikTex wieder von Ubuntu? (Ich bin Ubuntu Anfänger). Ich habe Miktex installiert und nun festgestellt, dass es da schon Tex-Live gibt, was ich lieber benutzen will.

    Danke
    Ulf

  25. Hi,
    regarding the question of “how to include /home/user/miktex-texmf tree in to your main Tex tree”, following is the easier way:

    # just add the following line in your .bashrc (or similar one)

    export TEXINPUTS=$TEXINPUTS:/home/user/miktex-texmf//

    thats it!
    I hope it will make things work.

  26. Pingback: [LaTeX] Synthesis of relevant links | Fun Statistics

  27. I wanted the following:
    Ubuntu,
    Eclipse,
    the Texclipse plug-in for eclipse,
    mpm, and
    TeX Live (Full)
    installed so that both the tlmgr package manager and the mpm package managers would play well together.

    I Installed Texlive-full via the syaptic installation manager.

    I installed mpm via the debian package listed at:
    http://miktex.org/unx/Default.aspx

    The root problem is to get the latex program (/usr/bin/latex) to search both of the following trees:
    /home/user/texmf
    /home/user/miktex-texmf
    when looking for installed Latex packages

    What worked for me was the following:

    Edit the main config file:
    sudo gedit /etc/texmf/texmf.d/05TeXMF.cnf

    Find this line:
    % User texmf trees are allowed as follows.
    % This used to be HOMETEXMF.
    TEXMFHOME = $HOME/texmf

    and just after this section add these lines:
    % User miktex-texmf trees are allowed as follows.
    % pointing at the miktex tree in your home directory
    TEXMFMIKTEX = $HOME/miktex-texmf

    Now add $TEXMFMIKTEX to the search tree. Find the following section and make the change to TEXMF as follows:

    % Now, list all the texmf trees. If you have multiple trees you can
    % use shell brace notation, like this:
    % TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
    % The braces are necessary.
    %
    % For texconfig to work properly, TEXMFCONFIG and TEXMFVAR should be named
    % explicitly and before all other trees.
    TEXMF = {$TEXMFCONFIG,$TEXMFVAR,$TEXMFHOME,$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFLOCAL,!!$TEXMFMAIN,!!$TEXMFDIST,$TEXMFMIKTEX}

    save and exit gedit.

    Now to propagate these changes to the texLive system wide:
    sudo update-texmf
    sudo mktexlsr
    sudo texhash

    You can check/confirm the configuration changes with
    texconfig conf
    texconfig-sys conf

    Now the package, foo, is found regardless if it is installed via
    sudo tlmgr install foo
    or installed via
    sudo mpm –install=foo

    This contribution is a distillation of the items above.
    I hope my distillation helps others.

    Thank you for your excellent help on this matter.

  28. Hello, I saw that someone else had the same problem as I have now, but I could not found any answer to the problem.
    When I’m running the command: cmake -G “Unix Makefiles”

    I get this error message:
    CMake Error: The source directory “/home/user/Downloads/miktex-tools-2.8.3541-1-i386-linux” does not appear to contain CMakeLists.txt.
    Specify –help for usage, or press the help button on the CMake GUI.

    I don’t have very much experience from linux, what is CMakeLists.txt and where should it be located?

    /Dan

  29. Thanks! it worked for me under ubuntu natty.

    I needed to install qt4 and a few other packets first… and installed the mpm 2.8.3541-1 instead…

  30. Thanks for the information! Nice to see that it works on Natty too.

  31. How can I install this on Lion? Thanks!

Leave a Reply

Required fields are marked *