Difference between revisions of "Ubuntu"

From Wiki
Jump to navigation Jump to search
(backport too hard for Dapper (6.06))
 
(29 intermediate revisions by 10 users not shown)
Line 1: Line 1:
Each successive version of Ubuntu becomes easier to update, which is why the following sections, arranged in reverse chronological order, get successively longer.
+
Here are instructions for ConTeXt installation on Ubuntu and its derivatives [K/X/L]ubuntu.
  
 +
== Precompiled / Packaged Nightly Builds From PPA ==
  
 +
Adam Reviczky was most generous to provide us with an Ubuntu PPA (Personal Package Archive) that contains precompiled Ubuntu packages for both ConTeXt and LuaTeX nightlies. Instructions for your version of Ubuntu are available for [https://launchpad.net/~reviczky/+archive/context-daily ConTeXt] and [https://launchpad.net/~reviczky/+archive/luatex-daily LuaTeX].
  
== Feisty (7.04) ==
+
== With Ubuntu packages – should work with Ubuntu 16.04 and above ==
  
Unfortunately, you cannot use the repository given in [[Debian installation]] because the Debian packages were compiled with a (very very slightly) newer libc6 than the one that ships with Ubuntu 7.04.  Here instead are very untested packages backported for Ubuntu 6.10 (edgy) and they should work on later versions too:
+
Note that Ubuntu's packaged version of ConTeXt is quite old ([https://packages.ubuntu.com/search?keywords=context circa 2015]), so a better option is the ConTeXt Standalone.
  
  <nowiki>deb    http://web.mit.edu/download/sanjoy/texlive-backports/ edgy/
+
TeX Live and ConTeXt have been part of Ubuntu's main repositories since Ubuntu 7.10, so you can simply
  deb-src http://web.mit.edu/download/sanjoy/texlive-backports/ edgy/</nowiki>
 
  
I use these packages on my ''feisty'' laptop with no problems so far (an hour of test), but let me (Sanjoy) know if you find anything broken.
+
  apt-get install context
  
With the above repository lines, you should be able to install the texlive packages. See the [[Debian installation]] instructions for the details.
+
to install ConTeXt and its dependencies (LuaTeX is part of the [https://packages.ubuntu.com/search?keywords=texlive-binaries texlive-binaries] package).
  
== Edgy (6.10) ==
+
The dependencies pull in various PDF utilities which you will probably find useful, including <code>pdfcrop</code>.
  
Use the backports given in the Feisty (7.04) section.
+
If you would like to use the [http://www.tug.org/texworks/ TeXworks] GUI-based TeX editing environment usually included with TeX Live CDs, it is available via
  
----
+
  apt-get install texworks
''I was able to install the libpoppler0c2 library, a recent texlive, and context 2007.04.17 on my laptop running Edgy simply by using the debian unstable repository. It seems to work fine. Backup your disk before mixing in packages from unstable.''
 
  
--[[User:Lee-phillips|Lee-phillips]] 05:57, 15 May 2007 (CEST)
+
and will appear under Applications, Science & Math.
  
''I don't think this method will work much longer, if it even still works.  The latest texlive packages in unstable require (for i386) a libc6 version >= 2.5-5, which is too recent even for feisty (by a tiny bit).  Probably you can keep upgrading to newer context packages because they do not depend on libc6.  But the pdftex and metapost binaries will not get updated (apt-get will hold back the packages that need a newer libc6).  Backports from gutsy (7.10) are one option.''
+
See also:
 +
* Setting up [[TeXworks]]
 +
* Setting up [[Scite]]
  
--[[User:sanjoy|Sanjoy Mahajan]] 22:45, 19 May 2007 (-0400)
+
=== Adding the system fonts ===
  
== Dapper (6.06) ==
+
The standard Ubuntu LuaTeX package does not scan any of your installed system fonts. Therefore you will want to set up the OSFONTDIR environment variable to point to all the font paths. For example:
  
Backporting from gutsy (7.10) results in a circular dependency, so I gave up on that plan as too hard. However,
+
  export OSFONTDIR=~/.fonts:/usr/share/fonts:/usr/share/texmf/fonts/opentype/:/opt/libreoffice/basis3.3/share/fonts/
Ubuntu 6.06 contains teTeX 3.0 (including ConTeXt 2005.01.31), so you can just install <code>tetex-extra</code> and use ConTeXt. However, once you got your feet wet, you will probably want to install a more recent pdfTeX than the 1.21a installed with Ubuntu (since ConTeXt can give you more features with newer pdfTeX's), so again, please follow the instructions for [[TeTeX_3.0 installation]].
 
  
The [[Linux_Installation#Updating_a_Linux_Installation:_Fedora_Core_5|instructions for Fedora Core 5]] are valid for Ubuntu 6.06, with a few caveats:
+
Once you have done that, run
  
* Ubuntu's default installation lacks a few tools that you'll need to build a new version of pdfTeX and '''to run new versions of ConTeXt'''.  So before upgrading, do:
+
    mtxrun --script fonts --reload
<pre> sudo apt-get install build-essential bison flex ruby </pre>
 
* The configuration files that users should edit are under <tt> /etc/texmf/texmf.d</tt>. '''Do not''' edit the <tt>.cnf</tt> files in <tt>/usr/share/texmf/web2c</tt> directly; instead, edit the configlet files in the <tt>.d</tt> directory and run <tt> update-texmf</tt> or <tt>update-updmap</tt>.
 
  
After doing all of the above, the new versions seem to be working:
+
If you have an error do this
  
<pre>
+
    luatools --generate
% texexec --version
 
  
TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005
+
to scan all the font directories. Then run
  
              texexec : TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005
+
    mtxrun --script fonts --list --all --pattern=*
              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.04.23 23:55
 
              cont-en : ver: 2006.04.23 23:55  fmt: 2006.4.24  mes: english
 
</pre>
 
  
== Breezy (5.10) ==
+
to list all the fonts LuaTeX now knows about. Finally, run
  
''Breezy's support ends in April 2007, so you are advised to upgrade (one Ubuntu release at a time) to a more recent release in order to run a secure system; Dapper (6.06) will be supported until 2009, so that could be a good choice.''  The following instructions are for those who cannot (or do not wish to) upgrade.
+
    context --reload
  
Ubuntu 5.10 does not include a TeX installation by default. The distribution that you get when you install TeX is teTeX-2.0.2, which is too old and will not work with recent ConTeXt versions. So you should not install it, but follow the instructions for [[TeTeX_3.0_installation]]. However, you first must install supplementary packages not included in Ubuntu by default (and I hope I'm not forgetting anything; a number of dependencies will automatically be installed as well):
+
to make sure ConTeXt's font cache is up to date.
  
  # sudo apt-get install build-essential bison flex libncurses5-dev ruby
+
If you are using TeXworks, you need to make sure that OSFONTDIR is set in the environment TeXworks runs in, because ConTeXt may decide it needs to rescan fonts.
  
Install these packages before trying to compile teTeX 3.0 or running newer ConTeXt release (which use ruby rather than perl), or you will get errors during the compilation or have problems running the results.
+
== With ConTeXt Standalone – should work with all Ubuntu versions==
 +
 
 +
Example of setting up [[ConTeXt Standalone]]:
 +
 
 +
  sudo mkdir /usr/local/context
 +
  sudo chown yourusername /usr/local/context
 +
  cd /usr/local/context
 +
  wget http://minimals.contextgarden.net/setup/first-setup.sh
 +
  sh first-setup.sh
 +
  vi ~/.bashrc
 +
 
 +
Add these three lines:
 +
 
 +
  export OSFONTDIR=~/.fonts:/usr/share/fonts                                                     
 +
  export TEXROOT=/usr/local/context/tex                                       
 +
  export PATH=/usr/local/context/tex/texmf-linux-64/bin:/usr/local/context/bin:$PATH
 +
 
 +
Note that the order of items in the PATH is significant. If you put /usr/local/context/bin in the path first, you will get an error at run time.
 +
 
 +
Also, remember that you have to source ~/.bashrc after changing it, in order to have the changes take effect in your current shell. (Either that, or start a new shell.)
 +
 
 +
===Installing third party modules in ConTeXt Standalone ===
 +
 
 +
See here: [[ConTeXt_Standalone#Installing_third_party_modules|Installing third party modules]]
 +
 
 +
===Updating ConTeXt Standalone===
 +
The update procedure is similar to [[ConTeXt_Standalone#Updating|the normal procedure]]. If you installed the ConTeXt Standalone with the commands from above, you can update to a new (beta) version like this:
 +
  cd /usr/local/context
 +
  wget http://minimals.contextgarden.net/setup/first-setup.sh
 +
  ./first-setup.sh --keep
 +
 
 +
{{Installation navbox}}

Latest revision as of 00:00, 23 August 2020

Here are instructions for ConTeXt installation on Ubuntu and its derivatives [K/X/L]ubuntu.

Precompiled / Packaged Nightly Builds From PPA

Adam Reviczky was most generous to provide us with an Ubuntu PPA (Personal Package Archive) that contains precompiled Ubuntu packages for both ConTeXt and LuaTeX nightlies. Instructions for your version of Ubuntu are available for ConTeXt and LuaTeX.

With Ubuntu packages – should work with Ubuntu 16.04 and above

Note that Ubuntu's packaged version of ConTeXt is quite old (circa 2015), so a better option is the ConTeXt Standalone.

TeX Live and ConTeXt have been part of Ubuntu's main repositories since Ubuntu 7.10, so you can simply

 apt-get install context

to install ConTeXt and its dependencies (LuaTeX is part of the texlive-binaries package).

The dependencies pull in various PDF utilities which you will probably find useful, including pdfcrop.

If you would like to use the TeXworks GUI-based TeX editing environment usually included with TeX Live CDs, it is available via

 apt-get install texworks

and will appear under Applications, Science & Math.

See also:

Adding the system fonts

The standard Ubuntu LuaTeX package does not scan any of your installed system fonts. Therefore you will want to set up the OSFONTDIR environment variable to point to all the font paths. For example:

  export OSFONTDIR=~/.fonts:/usr/share/fonts:/usr/share/texmf/fonts/opentype/:/opt/libreoffice/basis3.3/share/fonts/

Once you have done that, run

   mtxrun --script fonts --reload

If you have an error do this

   luatools --generate

to scan all the font directories. Then run

   mtxrun --script fonts --list --all --pattern=*

to list all the fonts LuaTeX now knows about. Finally, run

   context --reload

to make sure ConTeXt's font cache is up to date.

If you are using TeXworks, you need to make sure that OSFONTDIR is set in the environment TeXworks runs in, because ConTeXt may decide it needs to rescan fonts.

With ConTeXt Standalone – should work with all Ubuntu versions

Example of setting up ConTeXt Standalone:

 sudo mkdir /usr/local/context
 sudo chown yourusername /usr/local/context
 cd /usr/local/context
 wget http://minimals.contextgarden.net/setup/first-setup.sh
 sh first-setup.sh
 vi ~/.bashrc

Add these three lines:

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

Note that the order of items in the PATH is significant. If you put /usr/local/context/bin in the path first, you will get an error at run time.

Also, remember that you have to source ~/.bashrc after changing it, in order to have the changes take effect in your current shell. (Either that, or start a new shell.)

Installing third party modules in ConTeXt Standalone

See here: Installing third party modules

Updating ConTeXt Standalone

The update procedure is similar to the normal procedure. If you installed the ConTeXt Standalone with the commands from above, you can update to a new (beta) version like this:

 cd /usr/local/context
 wget http://minimals.contextgarden.net/setup/first-setup.sh
 ./first-setup.sh --keep