Go to page:

Search:   Help



LyX documentation


Shared groups



Categories: Tag me, Installing LyX
<< | Page list | >>

Notes about compiling LyX

  • It takes a bit of space... over 500 MB ... (this might go into the INSTALL file as a note.) You will get much less if you decide to not include debugging information by using the configure switch --disable-debug or --enable-build-type=release.
  • It also requires enough RAM: (On a machine with 128 MB RAM + 128 MB swap-space, it crashed after trashing for some hours, even with the --disable-debug switch).
  • If you compile from the SVN trunk, run the autogen.sh script first (needs automake > 1.5 and autoconf > 2.54).
  • If compiling on Ubuntu Linux and you want spellchecking capabilities, make sure you download the enchant and hunspell development libraries using Synaptic Package Manager.

Based on recommendation from Andre and John

  • Create a space to work in, say
     mkdir -p /space
(the option -p to mkdir means that it doesn't protest if /space already exists, as in my case).
  • Get the sources
    • Check out the svn version (this takes quite a while). Please read the LyX SVN Howto on how to do this.
    • Alternatively, using a tarball, do something like this:
          cd /space
          tar xzvf lyx-1.3.0.tar.gz
will create a directory /space/lyx-1.3.0/ for you, so in the instructions below you should replace lyx-devel with lyx-1.3.0.
  • Configure
     cd lyx-devel
or, e.g., (see the INSTALL file for configure switch explanations)
     ./configure --with-version-suffix=16  --enable-build-type=release 
  • Build and Install
     make install
or specify a destination directory, e.g.
     make DESTDIR=/tmp/lyx-inst install

Compiling and installing with GNU STOW

There are many reasons why you might want to keep your existing Linux installation but still update to a new version of LyX. Here you will learn how to do it without trashing your existing setup.

When finished, you will have both your existing LyX and the newest version. The trick is to install with GNU STOW.

These instructions are for Debian and Debian based distributions such as Ubuntu. On other distributions you will need to use some method other that Step 1 below to install the dependencies needed for compilation.

Getting the tools

First we need to get all the dependencies and tools to compile LyX:

  1. you@yourmachine:~$ sudo apt-get build-dep lyx
  2. you@yourmachine:~$ sudo apt-get install stow
  3. you@yourmachine:~$ sudo apt-get install automake
  4. you@yourmachine:~$ sudo apt-get install autoconf

This should get most or all of what you need. There may be a substantial download if you have no building tools already installed.

Making a working space ~/local

Your source files for the new version of LyX should be stored in a local directory. Why not name it "local"?

  • you@yourmachine:~$ mkdir local

Get the latest stable version of LyX

Download the source tarball from http://www.lyx.org/Download. The downloaded file will be named lyx-1.6.5.tar.gz or something similar (depending on what is the current latest version).

Depending upon your setup, the tar.gz file will be downloaded to your home directory, the ~/Desktop directory, the ~/Download directory or somewhere else. You need to move it to the ~/local directory:

  • you@yourmachine:~$ mv lyx-1.6.5.tar.gz ~/local

This assumes it has been downloaded to your home directory. If not adjust the command accordingly or use your file manager. However you do it, get the tar.gz file into the ~/local directory.

Compiling the new LyX

We are only going to compile at this stage, not install. Be sure you are in the ~/local directory.

1. you@yourmachine:~/local$ tar xovzf lyx-1.6.5.tar.gz

   This will create a new sub-directory under ~/local and will unpack
   the source files for lyx.

2. you@yourmachine:~/local$ cd lyx-1.6.5
3. you@yourmachine:~/local/lyx-1.6.5$ ./autogen.sh

   Check the output - if it says something is missing, then use
   apt-get to install it.

4. you@yourmachine:~/local/lyx-1.6.5$ ./configure --with-version-suffix=165

   We give it a different suffix so that it doesn't conflict with your
   existing LyX installation. You can use both the new version and the
   previously installed version. You can use any suffix that you like,
   but I would suggest either 16 or 165 to reflect the version of LyX
   that you are using.

   Check the output - if it says something is missing, then install
   using apt-get. Repeat the first autogen and configure steps.

5. you@yourmachine:~/local/lyx-1.6.5$ make

   Depending on your machine, this may take some time. If there is an
   error, then read the output. You probably need to use apt-get to
   install some new piece of software.


   We are going to use GNU Stow to install the new LyX. Stow allows
   you to keep your new version of LyX in a part of the hard disk that
   your package manager does not use. That way it is safe from any
   actions that your package manager might take. It also allows you to
   keep your existing LyX version intact.
  1. you@yourmachine:~/local/lyx-1.6.5$ sudo make install prefix=/usr/local/stow/lyx165
  2. you@yourmachine:~/local/lyx-1.6.5$ cd /usr/local/stow
  3. you@yourmachine:/usr/local/stow$ sudo stow lyx165

Running the new version

you@yourmachine:~$ lyx165

You can also make a "launcher" for the new version by right clicking on the panel. The command should be:


You can also run your old LyX version using the simple command:

you@yourmachine:~$ lyx

In a launcher, the command /usr/bin/lyx will run the old version.

Why use stow?

All modern Linux distributions use a package manager to install software from a repository. In most cases, the packages installed are subject to security updates or to other changes not determined by the user of the system.

When you compile and install special software, it is outside the scope of the package manager. Stow ensures that the special software is put in a place that is outside the view of the package manager. This ensures that the package manager will not overwrite your compiled version of LyX or, even worse, that your compiled version will trash libraries or other parts of your system managed by the package manager.

Stow cleverly "integrates" your compiled package using symbolic links. The compiled software appears to be part of your normal system but is isolated from it.

To use Stow, the final step of the usual ./configure, ./make ./make install process is changed. The final step is replaced by:

sudo make install prefix=/usr/local/stow/pkgname
cd /usr/local/stow
sudo stow pkgname

I also recommend using Stow when compiling the development version as described above.


Before you uninstall Lyx, you have to remove the symbolic links made by stow (if applicable). This is done with the command

  1. you@yourmachine:/usr/local/stow$ sudo stow -D lyx165

Then, execute:

  1. you@yourmachine:/usr/local/stow$ cd ~/local/lyx-1.6.5
  2. you@yourmachine:~/local/lyx-1.6.5$ sudo make uninstall prefix=/usr/local/stow/lyx165

Tag me

Installing LyX

Edit - History - Print - Recent Changes - All Recent Changes - Search
Page last modified on 2012-08-12 06:50 CEST