Lazarus release version for Ubuntu

From Lazarus wiki
Revision as of 21:21, 6 January 2015 by Jwdietrich (talk | contribs) (Replacing Linux platform template with Ubuntu template)
Jump to navigationJump to search
Logo-ubuntu cof-orange-hex.svg

This article applies to Ubuntu only.

See also: Multiplatform Programming Guide

Getting Lazarus from our Ubuntu repository

On there is a Ubuntu repository with Lazarus and FPC debs.

Short version: get Lazarus

In the sections that follow, there's a complete list of the commands you need to type at the console (or alternatives using the GUI) to download and install Lazarus on an Ubuntu system. If you're impatient, this section will just give you what you need to get it installed without going through every part of the process line by line.

Select and copy the following script, and save it as a file in your home directory named getlaz:

gpg --keyserver hkp:// --recv-keys 6A11800F
gpg --export 6A11800F | sudo apt-key add -
echo "deb lazarus-stable universe" > lazarus.list
sudo mv -v lazarus.list  /etc/apt/sources.list.d/lazarus.list
sudo apt-get update
sudo apt-get install -t lazarus-stable lazarus

At the shell prompt, type this to prepare the script for execution, and to execute it (you can copy these lines and paste them into your shell using Shift+Insert):

chmod +x getlaz

The process will download around 100Mb of data from the Lazarus repository and the standard ones. It will take at least five minutes, even with a fast connection. Any time it stops to ask for confirmation of any step, answer "Y" for yes.

When it finishes and returns to the shell prompt, you're set. Look in the "Development" section of your Ubuntu menu; Lazarus will be there and functional.

Long version: step by step

Now, for completists, here's the same instruction step by step. You can ignore it if you followed the above instructions successfully. Please remember to come back to the wiki and put in any tested, reliable changes that might clarify this section!

Add the key

Download the key from the public key server:

gpg --keyserver hkp:// --recv-keys 6A11800F

Add it to the apt system:

gpg -a --export 6A11800F | sudo apt-key add -

You can see the list of apt keys with:

sudo apt-key list

Add the repository

You can use synaptic/software package manager for this or edit the /etc/apt/sources.list directly. For the stable repository, add the line:

deb lazarus-stable universe

Or using a console do:

echo "deb lazarus-stable universe">/etc/apt/sources.list.d/lazarus.list

For the testing repository:

deb lazarus-testing universe

Or similarly, using a console do:

echo "deb lazarus-testing universe">/etc/apt/sources.list.d/lazarus.list

Note that trying the echo command you may get "bash: /etc/apt/sources.list.d/lazarus.list: Access denied" and the same with sources.list, even with sudo. Fortunately manually editing the file also works in this case.

An alternative repository

If you find this version not completely "Ubuntu-ish", that is, it doesn't completely fit with the Ubuntu Linux way of installing the program and the associated FPC libraries and Lazarus sources, you can try this alternative Ubuntu repository:

Install Lazarus

Now you can install Lazarus with apt:

sudo apt-get update; apt-get install -t lazarus-stable lazarus

The -t option prevents accidentally installing ubuntu's default packaged version of lazarus, which is often out of date compared to the version offered here.

Of course you can use a graphical software manager like Synaptic as well.

Hints for specific Ubuntu versions


Unity shows the menu bar like OS X on the top bar. You can change this for individual programs. Start lazarus with the command


or, from a batch file