Debian installation

From Wiki
Revision as of 05:09, 6 January 2007 by Sanjoy (talk | contribs) (use .debs instead of building from source)
Jump to navigation Jump to search

Use TeXLive packages

The context packages depend on TeXLive, so if you are using the Debian teTeX packages (e.g. see whether tetex-base is installed by doing "dpkg -l tetex-base"), it's time to make the change to TeXLive. You'll have to do it eventually since teTeX 3.0 will be its last upstream release. So if not now, when?

The directions for using TeXLive are at http://www.tug.org/texlive/debian.html

Make sure you install the texlive-metapost package if you do not have it already.


Install a Latin Modern font update

Do

 # apt-get install lmodern cm-super

Install the ConTeXt packages

Norbert Preining has produced reliable, complete ConTeXt packages for Debian, and they use very recent versions of ConTeXt (as of this writing, which is 2007.01.05, the latest package has the 2007.01.02 version of ConTeXt). Here's how to use them. Add these two lines to your /etc/apt/sources.list :

 deb http://www.tug.org/texlive/Debian/ context/
 deb-src http://www.tug.org/texlive/Debian/ context/

Then do

 apt-get update
 apt-get install context context-nonfree context-doc-nonfree

and apt will download and install the latest ConTeXt packages.

Steps to finish a first context upgrade

The Debian tetex-3.0 package (and probably the vanilla tetex-3.0) in combination with texexec puts user-generated format files in ~/.texmf-var/web2c/engine where engine is typically pdfetex. (If you don't have such a directory, and you are using the default tetex configuration, tell the mailing list so that this installation information can be corrected!)

The default tetex setup doesn't know about such locations (it doesn't know what it should), and it instead knows about other locations (it knows what it shouldn't). Here is how to fix both problems.

Older context formats

There may be older context formats lying around, and the path searching code may find these older ones instead of the new ones lovingy made by texexec.

Deleting the older context formats

So you need delete the older ones. But where are they?

When I ran texexec, it made cont-en.fmt, cont-nl.fmt, and mptopdf.fmt in ~/.texmf-var/web2c/pdfetex/ and they were shadowed by the older versions: ~/.texmf-var/web2c/cont-en.fmt, etc. So I deleted the older ones.

If you cannot find them, use kpsewhich cont-en.fmt (and similarly for the other formats). Run the kpsewhich from a 'typical' directory (e.g. your home directory), rather than from ~/.texmf-var/web2c/pdfetex/ (adjust for your engine), otherwise it will find the newly created formats before any others.

Stopping fmtutil from making context-related formats

But how did the older ones get there? fmtutil

And will it happen again? Yes, though perhaps rarely (the most frustrating kind of bug). At the next upgrade of tetex, which happens frequenty on Debian, the installation scripts will rerun fmtutil as root. That probably won't cause you trouble because the formats generated will go in a system-wide format directory (e.g. in /var/lib/texmf/web2c/), and your new ones will override them once you finish these steps.

However, if you, as an ordinary user, run texconfig, say to change your own default paper size from letter to a4, then tetex will regenerate all formats for you and put them in your format location ~/.texmf-var/web2c/ (without using the engine subdirectory). And you're in the soup again.

So stop fmtutil from making any context-related formats, and let texexec handle it. On standard tetex setups, you'd edit fmtutil.cnf (probaby in /var/lib/texmf/web2c/), but on Debian systems, that file is autogenerated from configlets (tiny pieces of a config file) living in /etc/texmf/fmt.d/.

As root:

 emacs -nw /etc/texmf/fmt.d/01tetex.cnf

(or choose your favorite editor). Comment out (with a #!) the lines for mptopdf, metafun, cont-en, and any other cont-* formats not already commented out. Now generate a new system-wide configuration file:

 update-fmtutil

Finding the new formats

The path searching code will not find the newer formats because the code doesn't search subdirectories of web2c/. The simple fix, telling it to search all subdirectories, does not work: Context may use several different engines, e.g. pdfetex or xetex, each with a set of formats, and you want texexec to find the correct set. If it searches all subdirectories, it will use the first set that it happens to run across, which may not match the engine that you use. Instead the searches should look in the subdirectory chosen according to the engine.

To specify this kind of search, you'd normally edit texmf.cnf directly, but Debian uses configlets for it. So edit (still as root) the TEXFORMATS line in /etc/texmf/texmf.d/45TeXinputs.cnf to include this magic:

 TEXFORMATS = .;$TEXMF/web2c/{$engine,}
 

It says to look first in the engine subdirectory, then in the web2c directory itself. Now generate a new texmf.cnf configuration file (still as root):

 update-texmf

That step generates a new /etc/texmf/texmf.cnf, which Debian symlinks from its standard tetex location /usr/share/texmf/web2c/texmf.cnf. With luck, you are done. In the next section you will check whether everything is working by running texexec --version (as yourself, not as root!).

Finished!

That should do it! The output of texexec --version (run as you, not as root) is hopefully like this:

TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005
              texexec : TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005
              texutil : TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004
                  tex : pdfeTeXk, 3.141592-1.30.4-2.2 (Web2C 7.5.5)
              context : ver: 2005.10.27
              cont-en : ver: 2005.10.27  fmt: 2005.11.1  mes: english

See also the Debian TeXlive install page.