I am trying to install ConTexT Standalone under LMDE, a Debian GNU/Linux operating system. I followed the system-wide installation instructions step-by-step without any problem. Except for the final step, executing . /opt/context/tex/setuptex, which fails in error:

bash: dirs: +P: invalid number
dirs: usage: dirs [-clpv] [+N] [-N]
"" is not a valid TEXROOT path.
(There is no file "/texmf/tex/plain/base/plain.tex")
provide a proper tex root (like '. setuptex /something/tex')

I also tried with adding the line:

export PATH="$PATH:/opt/context/tex/texmf-linux-64/bin" at the end of /etc/bash.bashrc to no avail. Surely, somebody over here must have ample experience with installing ConTeXt Standalone under Debian...

  • I've never seen that error. Does it also occur when you simply run wget http://minimals.contextgarden.net/setup/first-setup.sh && chmod +x first-setup.sh && ./first-setup.sh && . tex/setuptex
    – Marco
    Sep 9, 2013 at 16:38
  • @Marco I receive exactly the same error. It looks like setuptex is searching in vain for /texmf/tex/plain/base/plain.tex. Sep 9, 2013 at 18:13
  • i was going to comment but requires fifty plus reputation. i tried the same and unfortunately it did not work. although the errors on my system were different than yours, it required other files that i didn't have available. my suggestion, and perhaps this is not what you want, is to install texlive and add <code> PATH=/opt/context/tex/texmf-linux-64/bin/i386-linux:PATH$ </code> to the bashrc file.
    – doed
    Sep 9, 2013 at 18:22
  • Issuing find . -name plain.tex in /opt/context gives ./tex/texmf/tex/plain/base/plain.tex Sep 9, 2013 at 18:45
  • The error message shows a wrong path. It should look for /opt/context/tex/texmf/tex/plain/base/plain.tex instead of /texmf/tex/plain/base/plain.tex. Try . tex/setuptex tex. Which shell are you using?
    – Marco
    Sep 9, 2013 at 18:50

1 Answer 1


OK, I solved my problem. I had to adopt and adapt an excerpt of the ConTeXt Standalone instructions for Ubuntu. This is a bit weird, since LMDE is not based on Ubuntu at all. Conversely, Ubuntu sure is derived from Debian.

Here is the complete recipe:

sudo mkdir /opt/context
sudo chown $USER -R /opt/context
cd /opt/context
rsync -av rsync://contextgarden.net/minimals/setup/first-setup.sh .
sh ./first-setup.sh

sudo mkdir /var/cache/context
sudo mkdir /var/cache/context/texmf-cache
sudo chmod 777 /var/cache/context/texmf-cache
nano ./tex/texmf/web2c/texmfcnf.lua

Change the value of TEXMFCACHE from "$SELFAUTOPARENT/texmf-cache" to "/var/cache/context/texmf-cache", save and close.

So far, this was all pretty standard procedure. Now comes the Debian-specific bit.

Open the following file in your favourite editor: sudo nano /etc/bash.bashrc

At the end of this file, add the following lines in this specific order:

export OSFONTDIR=~/.fonts:/usr/share/fonts
export TEXROOT=/opt/context/tex
export PATH="/opt/context/tex/texmf-linux-64/bin:/opt/context/bin:$PATH"

Leave out the "-64" if you are using a 32-bit system. Save and close, then issue the following commands at the prompt:

source /etc/bash.bashrc
sh ./first-setup.sh --modules=all

Check with context --version

mtx-context     | ConTeXt Process Management 0.60
mtx-context     |
mtx-context     | main context file: /opt/context/tex/texmf-context/tex/context/base/context.mkiv
mtx-context     | current version: 2013.09.09 19:45
  • 1
    You are now using source <filename> instead of . <filename>. I don't really know the difference between the two, but I typically use source <..> instead of . <...>.
    – Aditya
    Sep 9, 2013 at 22:06
  • 2
    @Aditya The dot is specified by POSIX and the most portable way of sourcing a file in any shell. Some shells (e.g. bash and zsh) implement the source command which does the same as the dot. I typically use . <…> instead of source <…>.
    – Marco
    Sep 16, 2013 at 22:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.