Linux Installation

From ConTeXt wiki

Jump to: navigation, search

< Installation hints | TeX Distributions >

Contents

[edit] Overview

In decreasing order of simplicity, here are a few options:

  • (simplest) If you distribution supports TeXlive packages, use them. Debian, Ubuntu and openSUSE (if not too old) do so. See Debian installation or Ubuntu installation.
  • Otherwise, use a fresh TeXlive installation. The problem with this method is that you'll probably have to redo the installation once a year, when the new TeXLive DVD comes out.
  • If that won't work, try a teTeX 3.0 installation and then update the ConTeXt. Warning: teTeX is being decommissioned, so this solution is not for the long term.

Alternatively, if you need to use just ConTeXt (e.g. not LaTeX), you can use the ConTeXt minimal installation. See the directions that follow.

If you will use TeXLive, need to delete the distribution-provided teTeX packages, and are running an rpm-based distribution (RedHat, Mandrake, etc.), then you can most easily uninstall them like so:

 rpm --qa | grep tetex
 rpm --erase <package-names>

rpm's dependencies will tell you what other tex-related packages are installed but don't have 'tetex' in their names!

[edit] Debian

Details for Debian GNU/Linux are at Debian installation.

[edit] Ubuntu

Details for Ubuntu GNU/Linux are at Ubuntu installation.

[edit] SUSE/openSUSE

OpenSUSE (starting from 10.3beta3) comes with TeX Live and offers also XeTeX. 10.3b3 contains ConTeXt 2007.01.12.

OpenSUSE 10.2 (released December 2006) uses teTeX 3.0 and contains the 2005.01.31 version of ConTeXt that is standard in teTeX 3.0. The package is te_cont. [1] is an RPM repository where you can find it, but you should be able to install it using automated tools. Then you'll want to upgrade to a more recent version of ConTeXt. As with Suse 10 (see next paragraph), you'll also need the te_mpost and ruby packages.

For older distributions see also: [2]

[edit] Minimal ConTeXt distribution

An easy way to get up and running is to install the Linux version of the minimal ConTeXt distribution, which is available from the Pragma download page. This can be installed and run independently of any pre-existing TeX trees, which makes it much easier to deal with. Installation instructions are here.

In case you follow this path and find that you Linux machine is too out-of-date to run the binaries that are distributed in the minimal file set, you find help here.

[edit] TeXLive

From a fresh TeXlive installation in /usr/TeX some useful steps to getting an up-to-date ConTeXt are:

  • Set up the TeXlive fonts for ConTeXt use:
cd /usr/TeX/texmf/context/data
sudo texfont type-tmf.dat --en=texnansi --fontroot=/usr/TeX/texmf --install --makepath
  • Download the latest ConTeXt zip and unzip it into /usr/TeX/texmf/, replacing the files that are there.
  • Optionally, make any local modifications by copying files into /usr/TeX/texmf-local and then editing them.
  • Make updated format files in the texmf-var tree:
cd /usr/TeX/texmf-var
texexec --make --alone --all en nl uk metafun mptopdf

You should be ready to roll.

[edit] Updating a Linux Installation: Fedora Core 5

It is probably easier to start from a fresh tetex or texlive install, but it is also possible to upgrade ConTeXt from within an existing installation. I had a fresh install of Fedora Core 5 on my laptop and did want to keep it because this allows me to take advantage of the rpm system and upgrade and install other components more easily, and I (have to) use LaTeX from time to time. So I just tried around to see whether such an upgrade can be done. It worked for me, but please be aware that there may be problems somewhere that I have simply overlooked. With all these disclaimers in place, here is how I did it:

On a fresh install of Fedora core FC 5, you get these versions:

TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005

               texexec : TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005
               texutil : TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004
                   tex : pdfeTeX, 3.141592-1.21a-2.2 (Web2C 7.5.4)
               context : ver: 2005.01.31
               cont-en : ver: 2005.01.31  fmt: 2006.3.22  mes: english

Not very recent, as you can see. So the first thing we do is upgrade pdf(e)tex to a more recent version.

When I first ran the script build.sh in the pdftex directory (I downloaded a beta of version 1.40), it complained that it couldn't find the main texmf-tree, or rather, Fedora doesn't have it in the place where the script expects it. So we tell build.sh about the location. We open build.sh in an editor and, after line 46, we add this new line:

--datadir=/usr/share/ \

That's all. After this slight modification, build.sh works happily and compiles the new pdftex-version for us. This will take a while, so relax. After it is done, the build process will inform you about the files it has created:

-rwxr-xr-x 1 user wheel 1420548 Mar 23 14:40 build/texk/web2c/pdfetex
-rwxr-xr-x 1 user wheel 1420548 Mar 23 14:40 build/texk/web2c/pdftex
-rw-r--r-- 1 user wheel   38184 Mar 23 14:35 build/texk/web2c/pdftex.pool
-rwxr-xr-x 1 user wheel  517440 Mar 23 14:40 build/texk/web2c/pdftosrc
-rwxr-xr-x 1 user wheel   87276 Mar 23 14:40 build/texk/web2c/ttf2afm

As you know, we have to replace these files in your "old" installations with the ones we've just created. On a vanilla Fedora installation, there is no pdftosrc and ttf2afm, so we just dump them into /usr/bin. pdftex.pool doesn't exist either; I put it with the other .pool files into /usr/share/texmf/web2c/. After that, we run texhash and regenerate all formats that depend on pdftex, and on a modern TeX-installation, that means "all formats."

sudo fmtutil-sys --refresh

And, after a while, you see that all formats have been regenerated:

fmtutil: /usr/share/texmf-var/web2c/aleph.fmt installed.
fmtutil: /usr/share/texmf-var/web2c/amstex.fmt installed.
fmtutil: /usr/share/texmf-var/web2c/bamstex.fmt installed.
fmtutil: /usr/share/texmf-var/web2c/bplain.fmt installed.
fmtutil: /usr/share/texmf-var/web2c/cont-en.fmt installed.
fmtutil: /usr/share/texmf-var/web2c/etex.fmt installed.
fmtutil: /usr/share/texmf-var/web2c/lambda.fmt installed.
fmtutil: /usr/share/texmf-var/web2c/lamed.fmt installed.
fmtutil: /usr/share/texmf-var/web2c/latex.fmt installed.
fmtutil: /usr/share/texmf-var/web2c/mptopdf.fmt installed.
fmtutil: /usr/share/texmf-var/web2c/omega.fmt installed.
fmtutil: /usr/share/texmf-var/web2c/pdfetex.fmt installed.
fmtutil: /usr/share/texmf-var/web2c/pdflatex.fmt installed.
fmtutil: /usr/share/texmf-var/web2c/pdftex.fmt installed.
fmtutil: /usr/share/texmf-var/web2c/tex.fmt installed.
fmtutil: /usr/share/texmf-var/web2c/metafun.mem installed.
fmtutil: /usr/share/texmf-var/web2c/mpost.mem installed.
fmtutil: /usr/share/texmf-var/web2c/mf.base installed.

If you happen to use other TeX engines from time to time (as I do), try if they are still working.

Next up: upgrading ConTeXt itself. The setup I wanted was: have a local texmf-tree in which I'd put the "new" ConTeXt files. If ever anything goes wrong, I can still delete (or simply rename) this tree and revert to the old ConTeXt that came with FC 5.

Now here's the catch: first, we need to have a look at the way FC 5 sets up its texmf-trees. This is defined in the file /usr/share/texmf/web2c/texmf.cnf. We open it in an editor and have a look at it. The important line is 114:

TEXMF = {!!$TEXMFCONFIG,!!$TEXMFVAR,$TEXMFHOME,!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFLOCAL,!!$TEXMFMAIN,!!$TEXMFDIST}

These variables are set further up in the file. The first two are trees for setting variables; they live in your home directory and do not exist by default unless you use texconfig. Then comes the texmf-tree in your home directory; this comes first so everything you put there will be found first. Then, two more trees to store variables, and then, the local tree, which is defined as /usr/local/share/texmf. This directory does not exist either. We create it:

cd /usr/local/share
mkdir texmf
cd texmf

This is where we will unzip the "new" ConTeXt. Copy cont-tmf.zip to this directory and unzip it here:

unzip cont-tmf.zip

Some lines of output will whiz by, then your local tree exists. Run texhash, and your new tree should be recognized. As a test, let's look for a file that exists in both the old and the new tree:

kpsewhere cont-new.tex

and you should see this return:

/usr/local/share/texmf/tex/context/base/cont-new.tex
/usr/share/texmf/tex/context/base/cont-new.tex

which means: the file is found both in the local and in the main tree, and the one in the local tree is found first! That's exactly what we wanted.

While you're at it, also copy cont-lmt.zip into your local tree, unzip it, and run texhash afterwards.

Now the most important step: regenerating the formats. This is a somewhat difficult point, for two reasons:

  • Fedora lets fmtutil manage the formats; teTeX 3.0 installation, on the other hand, recommends that you let texexec do this for you. You probably should follow the advice given there and remove ConTeXt from fmtutil's list so it doesn't overwrite the formats you create yourself.

For me, on FC 5, the long and short of it was: after running

texexec --make --all

the new format files were put under /usr/share/texmf-var/web2c/pdfetex. But there are still old formats up one directory, under /usr/share/texmf-var/web2c. Even though I edited texmf.cnf to recognize the engine path and deleted these old format files, the TeX installation in FC 5 would not recognize them. In the end, I took an approach which may not be a very clean solution, but it was quick: what I did was simply remove the old format files from /usr/share/texmf-var/web2c (these are cont-en.fmt and mptopdf.fmt) and put symbolic links to the files in /usr/share/texmf-var/web2c/pdfetex into this directory:

cd /usr/share/texmf-var/web2c
ln -s pdfetex/cont-en.fmt .
ln -s pdfetex/cont-nl.fmt .
ln -s pdfetex/mptopdf.fmt .

After that, I could finally enjoy my new version:

 % texexec --version

 TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005

               texexec : TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005
               texutil : TeXUtil 9.0.1 - ConTeXt / PRAGMA ADE 1992-2006
                   tex : pdfTeX, 3.141592-1.40.0-beta-20060213 (Web2C 7.5.5)
               context : ver: 2006.03.20 10:19
               cont-en : ver: 2006.03.20 10:19  fmt: 2006.3.23  mes: english
               cont-nl : ver: 2006.03.20 10:19  fmt: 2006.3.23  mes: dutch

So far, everything seems to be working.

Note: I installed Fedora Core FC 6 this weekend on my laptop, and it still comes with the same old ConTeXt version mentioned above, pdftex 1.21a and ConTeXt 2005.01.31. Talk about a cutting-edge distribution...

[edit] Updating Gentoo Linux

I found the tetex installation in Gentoo linux to be unnecessarily complicated. Nevertheless, after some fiddling around, I did manage to update it to the latest releases of pdftex and ConTeXt.

In order to run recent versions of ConTeXt, you will also need to install ruby, which is not installed by default:

emerge ruby -p

These are the packages that would be merged, in order:

Calculating dependencies... done!
[binary   N   ] dev-lang/ruby-1.8.4-r1


Gentoo usually is proud of its cutting-edge installations, but for teTeX, the stable version you get with the portage system is 2.0.2-r8. However, it's relatively easy to install (or upgrade to) a more recent version. The easiest way is with this command (this is on a ppc system, replace with other constructs of ~<arch> as suitable):

ACCEPT_KEYWORDS="~ppc" emerge tetex -p

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   N   ] app-text/tetex-3.0_p1-r3  USE="-doc*"

After emerging, you get a not-too-old version:

texexec --version

 TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005

               texexec : TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005
               texutil : TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004
                   tex : pdfeTeX, 3.141592-1.30.5-2.2 (Web2C 7.5.5)
               context : ver: 2005.01.31
               cont-en : ver: 2005.01.31  fmt: 2006.5.6  mes: english

        total run time : 2 seconds


Upgrading is basically the same as TeTeX 3.0 installation. Again, there are some caveats and gotchas that you need to be aware of:

  • The texmf.cnf that you may need to modify resides in /etc/texmf/texmf.d/00texmf.cnf. Edit it and run texmf-update to update /etc/texmf/web2c/texmf.cnf.
  • The fmtutil.cnf that you may need to modify resides in /etc/texmf/fmtutil.d/00fmtutil.cnf. Edit it and run texmf-update to update /etc/texmf/web2c/fmtutil.cnf
  • I recommend to unpack cont-tmf.zip to /usr/share/texmf instead of /usr/local/teTeX/share/texmf-local
  • If you want to update MetaPost, I recommend to use folder /usr/share/texmf instead of /usr/local/teTeX/share
  • To update Latin Modern fonts, unpack lm.zip and copy content of fonts folder to /usr/share/texmf
  • When you build the latest version of pdftex, be sure to edit build.sh and provide the right path, so edit line ../src/configure --prefix=/usr \ . After that, replace the binaries in /usr/bin, keep/make pdftex symlink to pdfetex and copy pdftex.pool to /var/lib/texmf/web2c and/or to /usr/share/texmf/web2c.




[edit] fmtutil.cnf

Edit the file /etc/texmf/fmtutil.d/00fmtutil.cnf.

  Line 47 should be: 
pdfetex		pdfetex		language.def	-etex -translate-file=cp227.tcx *pdfetex.ini # !!! note the star before 'pdfetex.ini'

  Lines 68 and 69 should be:
#cont-en	pdfetex		cont-usr.tex	-etex -translate-file=cp227.tcx *cont-en.ini
#cont-nl	pdfetex		cont-usr.tex	-etex -translate-file=cp227.tcx *cont-nl.ini

[edit] pdfetex update

Fetch the 1.40.0 release (tar or zip archive) from [sarovar].

From within the directory where you downloaded the archive file, execute the following series of commands:

 # tar -xvf pdftex-1.40.3.tar.bz2
 # cd pdftex-1.40.3
 # ./build.sh

Before runnig build.sh, you may need to edit it, for example changing line 56 to ../src/configure --prefix=/usr \. You may also consider changing your CFLAGS.

 # CFLAGS="-O2 -march=<your-arch> -fweb -frename-registers -fomit-frame-pointer -pipe"
 # CXXFLAGS="${CFLAGS}"
 # export CFLAGS CXXFLAGS
 # ./build.sh

If the build went OK, then the last four lines of terminal output are the actual binaries and pool files for pdftex and pdfetex. These have to replace their existing counterparts in the teTeX installation.

Check whether old files are in place we expect them to be.

 # which pdftex pdfetex pdftosrc ttf2afm && kpsewhich pdfetex.pool

We should get:

/usr/bin/pdftex
/usr/bin/pdfetex
/usr/bin/pdftosrc
/usr/bin/ttf2afm
/var/lib/texmf/web2c/pdfetex.pool

If so, let's overwrite oldies.

 # cp -vf build/texk/web2c/{pdfetex,pdftosrc,ttf2afm} /usr/bin/
 # cp -vf build/texk/web2c/pdftex.pool /var/lib/texmf/web2c/pdftex.pool
 # cp -vf build/texk/web2c/pdftex.pool /var/lib/texmf/web2c/pdfetex.pool

Make sure /usr/bin/pdftex and /usr/bin/pdflatex are symlinks to pdfetex. If not, correct it.

[edit] metapost update

If you want, you can fetch and install the latest MetaPost, get it from [3].

# tar xjf metapost-0.994-src.tar.bz2 
# cd metapost-0.994

Again, before runnig build.sh, you may need to edit it, for example changing line 28 to ../src/configure --prefix=/usr \. If your CFLAGS were changed since installing pdftex, reset them.

# CFLAGS="-O2 -march=<your-arch> -fweb -frename-registers -fomit-frame-pointer -pipe"
# CXXFLAGS="${CFLAGS}"
# export CFLAGS CXXFLAGS
# ./build.linux

... to be continued

  • To aviod some errors (... increase POOLSIZE/I can't find the format file ...) I had to make some symliks and run texhash:
/usr/share/texmf/web2c :
  fmtutil.cnf -> /etc/texmf/web2c/fmtutil.cnf
  texmf.cnf   -> /etc/texmf/web2c/texmf.cnf
  updmap.cfg  -> /etc/texmf/web2c/updmap.cfg

/var/lib/texmf/web2c :
  fmtutil.cnf -> /etc/texmf/web2c/fmtutil.cnf
  texmf.cnf   -> /etc/texmf/web2c/texmf.cnf
  updmap.cfg  -> /etc/texmf/web2c/updmap.cfg
  mptopdf.fmt -> pdfetex/mptopdf.fmt
  cont-en.fmt -> pdfetex/cont-en.fmt
  cont-nl.fmt -> pdfetex/cont-nl.fmt

~/.texmf-var/web2c :
  mptopdf.fmt -> pdfetex/mptopdf.fmt
  cont-en.fmt -> pdfetex/cont-en.fmt
  cont-nl.fmt -> pdfetex/cont-nl.fmt

Some(all?) of these symlinks would probably be unnecessary, if I set configuration files properly. Can anybody help me?


Procedure above seems to upgrade to the latest versions on my system:

my_gentoo ~ # texexec --check|tail -n 24
Output written on texexec.pdf (1 page, 21782 bytes).
Transcript written on texexec.log.
TeXExec | runtime: 0.913663
TeXExec | end of analysis
TeXExec | 
TeXExec | TeXExec | version 6.2.0 - 1997-2006 - PRAGMA ADE/POD
TeXExec | TeXUtil   | version 9.1.0 - 1997-2005 - PRAGMA ADE/POD
TeXExec | CtxTools | version 1.3.3 - 2004/2006 - PRAGMA ADE/POD
TeXExec | 
TeXExec | testing interface en
TeXExec | pdfTeX Version 3.141592-1.40.0 (Web2C 7.5.6)
TeXExec | ConTeXt ver: 2006.12.27 11:34 MK II fmt: 2007.1.3 int: english/english
TeXExec | 
TeXExec | testing interface nl
TeXExec | pdfTeX Version 3.141592-1.40.0 (Web2C 7.5.6)
TeXExec | ConTeXt ver: 2006.12.27 11:34 MK II fmt: 2007.1.3 int: dutch/dutch
TeXExec | 
TeXExec | testing interface en
TeXExec | pdfTeX Version 3.141592-1.40.0 (Web2C 7.5.6)
TeXExec | ConTeXt ver: 2006.12.27 11:34 MK II fmt: 2007.1.3 int: english/english
TeXExec | 
TeXExec | testing interface nl
TeXExec | pdfTeX Version 3.141592-1.40.0 (Web2C 7.5.6)
TeXExec | ConTeXt ver: 2006.12.27 11:34 MK II fmt: 2007.1.3 int: dutch/dutch

Zdenek 17:55, 3 January 2007 (CET)

Thomas 22:57, 23 March 2006 (CET)

[edit] texexec --version - complaining about missing fonts

If you, like me, keep getting output like this:

# texexec --version

 TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005

               texexec : TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005
               texutil : TeXUtil 9.0.1 - ConTeXt / PRAGMA ADE 1992-2006
kpathsea: Running mktextfm ec-lmr12
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input ec-lmr12
This is METAFONT, Version 2.71828 (Web2C 7.5.4)

kpathsea: Running mktexmf ec-lmr12
! I can't find file `ec-lmr12'.
<*> ...ljfour; mag:=1; nonstopmode; input ec-lmr12

Please type another input file name
! Emergency stop.
<*> ...ljfour; mag:=1; nonstopmode; input ec-lmr12

Transcript written on mfput.log.
grep: ec-lmr12.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input ec-lmr12' failed to make ec-lmr12.tfm.
kpathsea: Appending font creation commands to missfont.log.
kpathsea: Running mktextfm ec-lmr7
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input ec-lmr7
This is METAFONT, Version 2.71828 (Web2C 7.5.4)

kpathsea: Running mktexmf ec-lmr7
! I can't find file `ec-lmr7'.
<*> ...=ljfour; mag:=1; nonstopmode; input ec-lmr7

then, you have to look for cont-sys.tex or code-usr.tex files in the main teTeX tree, which appear out of date. For example, I have the new ConTeXt files in the /usr/local/share/texmf tree:

# locate cont-usr.tex
/usr/local/share/texmf/tex/context/config/cont-usr.tex
/usr/share/texmf/tex/context/config/cont-usr.tex

Alternatively to locate, you can also use iteratively kpsewhich cont-usr.tex (don't forget to run texhash after deleting files).

Now, remove or rename the last file (the one supplied by the teTeX distribution) and once again execute texexec --make --all, and (hopefully) the problem will be resolved.

If this fails, you can try to install the latest Latin fonts, as described in the TeTeX 3.0 installation.

--RKB 11:08, 15 June 2006 (CEST)

Personal tools
Toolbox