Installing Lazarus in Linux
The Lazarus IDE is available as binary packages for Linux in the Red Hat Package
Management (RPM) format, Debian
(DEB) format, or in tar gzip format. These packages are available for 32-bit or 64-bit distributions of Linux. Certain distributions of Linux, such as Ubuntu, make Lazarus available through their custom package managers. For information on installing Lazarus using such package management software, check the instructions available from the distribution's website or manuals.
Downloading and installing the Lazarus Linux RPM package
The Lazarus binary
RPM package is available from the Lazarus SourceForge.net (http://sourceforge.net/projects/lazarus/files/) download area. Once you have accessed this page, choose the correct link for your platform package, in this case either Lazarus Linux x86_64 RPM
for 64-bit platforms or Lazarus Linux i386 RPM
for 32-bit platforms. We will be using the 32-bit package for this example. After clicking on the correct link, choose the current release link, in this case Lazarus 1.0.2
. Once you are in this area, all the packages needed to install Lazarus are available to be downloaded. Download the following packages:
Also available is the optional package, fpc-debuginfo-2.6.0-0.laz.i686.rpm
, which provides debug information for the system units. This is only needed if you want to do development for Free Pascal itself, which is beyond the scope of this book.
Before installing Free Pascal and Lazarus, the following programs are required on the Linux system:
GNU as the GNU assembler
GNU Id or the GNU linker
GNU Make, this is optional but recommended for easy recompiling of the FPC compiler and
Run-Time Library (RTL).
Lazarus requires the following libraries:
GTK+ 2.x or Qt: Most Linux distributions already install GTK+ 2.x. You can also download the libraries from http://www.gtk.org. Qt is also supported by most distributions and is installed together with KDE.
To begin the installation of Lazarus, log into your system as a root user. First install the Free Pascal for the Lazarus package containing the following command:
After the successful completion of this package, next we will need to install the Free Pascal source code package. The Free Pascal source code package is required to operate certain functions in Lazarus. If the IDE cannot find the Free Pascal source, the user will be presented with a warning box with the following message:
The Free Pascal source was not found. Some functions will not work.
To install the Free Pascal source, use the following command:
After the successful completion of the installation of the Free Pascal source, all that is left to do is to install the Lazarus IDE itself with the following command:
With the successful completion of these three packages, you are ready to use the Lazarus IDE. Under the GNOME desktop, Lazarus can be accessed from the Applications menu under the Programming submenu.
Downloading and installing the Lazarus Linux DEB package
For Debian-based Linux distributions, the SourceForge.net Lazarus repository contains Debian packages for 32-bit and 64-bit distributions. Access the SourceForge.net repository at http://sourceforge.net/projects/lazarus/files/. For 32-bit Debian-based distributions, choose the Lazarus Linux i386 DEB
subfolder. For 64-bit Debian-based distributions, choose the Lazarus Linux amd64 DEB
subfolder. Next, choose the current Lazarus release, which at the time of writing is Lazarus 1.0.2
. Download all the Debian packages within this folder.
For 32-bit systems:
For 64-bit systems:
lazarus_1.0.2-0_amd64.deb
fpc-src_2.6.0-120824_amd64.deb
fpc_2.6.0-120824_amd64.deb
Once the packages are downloaded, install them using the following command:
Install each of the packages for Free Pascal, Free Pascal Source, and the Lazarus IDE.
There is an Ubuntu repository available at http://www.hu.freepascal.org that contains Lazarus and FPC debs. This repository can be used with apt-get
. Before using this repository with apt-get
, it first needs to be added to the apt.
First, we need to add the repository's gpg
key to the apt
keys with the following commands as a root user:
Next, add the repository by editing /etc/apt/sources.list
, adding the following line:
Once the repository is added to the list of available repositories, Lazarus can be installed with the following commands, again as root: