Installation of Miktex – a latex package manager – for Ubuntu

GraphHopper – A Java routing engine

karussell ads

Did you ever have hassle with manual installation of packages (.sty files) in latex under linux? If yes the following procedure will help you a lot to make the windows-latex-packagemanager called miktex working under linux. With this manager it is one command or one click to install a package without any websearches!!

  1. Download the .deb file from here.
  2. sudo dpkg -i ~/Download/miktex-tools-2.8_beta_2-1-i386-linux.deb
    Sometimes a sudo apt-get install libcurl3 was necessary
  3. initexmf --help
  4. sudo initexmf --admin --user-install=/var/lib/texmf/
  5. Now try to install the fltpage (and include it via \usepackage[rightFloats]{fltpage} into the .text source)
    sudo mpm --install=fltpage
  6. Sometimes I needed (sometimes not) to run the following command after I installed a package:
    sudo texhash
  7. to update all installed packages simply run
    sudo mpm --update
  8. to find a package you can use the following command
    sudo mpm --list | grep a0

    => a0poster

Thats all! And it is nice! A lot better than manual installation.

18 thoughts on “Installation of Miktex – a latex package manager – for Ubuntu

  1. How were you able to initexmf to work? I’ve tried installing the most recent version of the package (on Ubuntu 9.04 and 9.10), and all I get is an error on installation. While mpm will work (nominally), I can’t specify the download directory as you appeared to have done. Are there any more recent packages that don’t throw this error?

  2. initexmf –unexpected option. I’ve since tried manually compiling the tool set, and while that worked out better, it was still extremely unreliable. The package manager wasn’t able to download the package lists from any of the online repositories.

  3. I use Ubuntu 9.1 64 bit
    I tray to install MikTeX 2.8 and no success
    I have .deb .rpm and tar.gz but no solution for make taht work

  4. initexmf: error while loading shared libraries: liburiparser.so.1: cannot open shared object file: No such file or directory

    This is error what I get

  5. miktex-tools-2.8.3541-1-i386-linux.deb
    miroslav@ubuntu:~/src$ sudo dpkg -i miktex-tools-2.8.3541-1-i386-linux.deb
    Selecting previously deselected package miktex-tools.
    (Reading database … 260983 files and directories currently installed.)
    Unpacking miktex-tools (from miktex-tools-2.8.3541-1-i386-linux.deb) …
    Setting up miktex-tools (2.8.3541-1) …
    initexmf: Unexpected condition.
    dpkg: error processing miktex-tools (–install):
    subprocess installed post-installation script returned error exit status 1
    Processing triggers for man-db …
    Errors were encountered while processing:
    miktex-tools

  6. The same error on ubuntu 9.04 32 bits:

    Configurando miktex-tools (2.8.3541-1) …
    initexmf: Unexpected condition.
    dpkg: error al procesar miktex-tools (–configure):
    el subproceso post-installation script devolvió el código de salida de error 1
    Se encontraron errores al procesar:
    miktex-tools

  7. hi, i tried to install miktex on my ubuntu.but it says there is an error!!what to do now???plss help me out!!actually i need to use verbatim environment in latex..can u tell me how to install this package!!thanx.

  8. I would suggest that you ask this in an ubuntu forum (but don’t forget to post the error message etc)

    BTW: the verbatim environment should be usable without installation of any package, in my opinion.

  9. Why don’t you just download the latex packages you need through the synaptic package manager?

  10. Hi All – I just installed MikTex Tools on my 64-bit ubuntu platform. I made the necessary edits to line 100 of PackageTableModel.cpp, as described in various other posts.

    I did all the commands in the README.UNX file, in
    cmake -G “Unix Makefiles”
    make
    sudo make install
    sudo initexmf –admin –configure
    sudo mpm –admin –update-db
    initexmf –update-fndb

    Except, I had to use the mpm GUI to update the MiKTeX database, since I could not figure out how to have the command-line mpm communicate through an FTP proxy server.

    When I try to compile a .tex file, I get the following error.

    % /mnt/masivs/FOCAL10/data/ground/outputs_generated-20101008$ miktex-pdftex QuickLook_FOCAL10_20101008_113103.tex
    This is pdfTeX, Version 3.1415926-1.40.9 (MiKTeX Tools 2.8 Beta 2)
    initexmf: Unknown format name/engine: miktex-pdftex/pdfTeX
    I can’t find the default format file!

    I also tried
    % miktex-pdftex -initialize pdflatex.ini
    but got the same error.

    I also tried
    % miktex-pdftex –undump=latex sample2e
    but still got the same error.

    I have the files
    /home/jroth/.miktex/miktex/config/miktex.ini and miktexstartup.ini
    But I don’t have a config.ini file there, which some documentation described.

    I had a previous version of pdflatex on the platform, which I barely used but seems to work okay. But it does not automatically load needed packages like MiKTeX Tools.

    Any help would be much appreciated!

    Thank you! Jeff

    • One other point is that the MPM miktex-pdftex packages are going to:
      /home/jroth/miktex-texmf/tex/latex/

      While the pre-existing pdflatex packages (not updated by MPM) seem to exist at:
      /usr/share/texmf-texlive/tex/latex/

      Thanks! Jeff

  11. Here is what worked for me. I appologize for the length, but deatils matter.

    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 TeX Live 2010 with the script install-tl and instructions found here:
    http://tug.org/texlive/quickinstall.html

    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

    Here is what worked for me:

    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 TeX Live 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

    I hope this helps others.

    • Thank you so much, i have been two hours looking everywhere an finally it works. I would love to share a link to this answer as I have seen that in many forums people have the same problem.

      thank again John

  12. hi,
    iam susaji,
    i have this error when i run the setup in archive manager.i got the setup from CTAN:directory.

    Archive: /home/susaji/Downloads/setup-2.9.3959.exe
    [/home/susaji/Downloads/setup-2.9.3959.exe]
    End-of-central-directory signature not found. Either this file is not
    a zipfile, or it constitutes one disk of a multi-part archive. In the
    latter case the central directory and zipfile comment will be found on
    the last disk(s) of this archive.
    zipinfo: cannot find zipfile directory in one of /home/susaji/Downloads/setup-2.9.3959.exe or
    /home/susaji/Downloads/setup-2.9.3959.exe.zip, and cannot find /home/susaji/Downloads/setup-2.9.3959.exe.ZIP, period.

    and
    when i type sudo apt-get install texlive in terminal it shows;
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package texlive

    kindly help me out with this

Comments are closed.