Install Lazarus and Free Pascal on Ubuntu

Ubuntu 11, 12 and 14 doesn't contain recent version of Lazarus in repository. Here are some instruction to install it.

Remove existing installation:

sudo apt-get purge fpc lazarus
sudo rm -Rf /usr/lib/fpc
sudo rm -Rf /usr/lib/lazarus
sudo rm -Rf /usr/share/fpcsrc

It is not necessary, but you can clear old settings too:

sudo rm -Rf ~/.fpc
sudo rm -Rf ~/.lazarus

Now download deb packages corresponding to your environment from Lazarus's sourceforge site. Three packages are required:

  • fpc_nnn_mmm.deb
  • fpc-src_nnn_mmm.deb
  • lazarus_xxx_mmm.deb

where "nnn" et "xxx" are the the versions and "mmm" is the target platform i.e. amd64.

Install development version of libgtk2:

sudo apt-get install libgtk2.0-dev

Go to download directory and start installation:

sudo dpkg -i *.deb

You are ready to launch Lazarus now.

If you want to see main menu in the same window you should do it from terminal or create a small shell script:


How to create a shortcut to start your script from desktop in Ubuntu 12+ (Unity)?

sudo apt-get install --no-install-recommends gnome-panel
gnome-desktop-item-edit ~/Desktop/ --create-new

Follow instructions.