I’ve previously blogged on installing lazarus on ubuntu but unfortunately upgrading to ubuntu 11.10 broke my lazarus installation
Here’s how I fixed it all.
1. Totally remove previous Lazarus and fpc installations
sudo apt-get purge lazarus*
sudo apt-get purge fpc*
sudo rm -Rf /usr/lib/fpc
sudo rm -Rf /usr/lib/lazarus
sudo rm -Rf /usr/share/fpcsrc
sudo rm -f ~/.fpc
sudo rm -Rf ~/.lazarus
sudo rm -f /usr/bin/lazarus*
sudo rm -f /usr/bin/lazres*
sudo rm -f /usr/bin/lazbuild*
sudo rm -f ~/.local/share/applications/lazarus*
2. Install fpc so you can use it from the command line
sudo apt-get install fp-compiler-2.4.4
You can see if this has worked properly by writing a hello world command line app, comiling it and running it before you’ve even tried to install lazarus. Save the following in a file called cmdline_helloworld.pas:
begin
writeln(‘hello world!’);
end.
Then compile using
fpc cmdline_helloworld.pas
and run using:
./cmdline_helloworld
3. Install lazarus
sudo apt-get install lazarus
You probably need to disable overlay scrollbars otherwise you can get problems using menus and dialogs in Lazarus and apps made with lazarus:
export LIBOVERLAY_SCROLLBAR=0
if you don’t want to make such a global change then just make a script to start lazarus like this:
#!/bin/sh
LIBOVERLAY_SCROLLBAR=0 lazarus-ide
4. Change IDE settings to make it easier to use with Unity
Unity is annoying for many reasons, but it doesn’t deal with multi-window apps like Lazarus very well. So here’s some suggestions to make it all behave a bit better.
First, if you use a taskbar plugin like tint you can have Lazarus only show one button rather than loads on the task bar (Environment -> Options -> Window and slect “Show single button in Taskbar” at the top.
Second, I recommend making lazarus use single window mode. This is a little experimental but I think it’s a major improvement over the old-fashioned pre-Delphi 2005 layout.
Normal layout:
To transform Lazarus into a single window mode application you need to install the AnchorDockingDsgn package which is helpfully installed with Lazarus. On ubuntu in a standard installation it’ll be in /usr/lib/lazarus/0.9.30/examples/anchordocking/design.
Do this as sudo otherwise the recompiling process doesn’t have enough rights to backup packages and wotnot. So start lazarus by doing
sudo lazarus-ide
In Lazarus File -> Open and browse to anchordockingdsgn.lpk
When the package editor comes up select the install button. Lazarus will ask for confirmation and tell you only static packages are supported so you need to rebuild lazarus (that really needs sorting out!), say yes and then sit back and enjoy the compilation process.
Next time you start Lazarus it’ll be in single window mode. For some reason the Object Inspector (F11) isn’t docked by default but you can easily add it yourself.



Thanks for the steps, but do you know how to install only fpc instead of lazarus. Fpc in the sense, the blue screen with the yellow text and all that…
Hi, sorry I’ve not tried to just install fpc. Although I did by accident a couple of times while trying and failing to get Lazarus installed I didn’t write down what I did.
Hello,
Tried the above and I get stuck on the actual cmd
“In Lazarus File -> Open and browse to anchordockingdsgn.lpk
When the package editor comes up select the install button. Lazarus will ask for confirmation and tell you only static packages are supported so you need to rebuild lazarus (that really needs sorting out!), say yes and then sit back and enjoy the compilation process.”
During compilation lazarus tells me that I have a missing unit, I now some delphi, but actually never used lazarus. Can you help me. All unit for the anchorsockingdsgn.lpk exist in the directory, also no error during lazarus install concerning missing package. I do this on a 64bit
kind regards
Johan
Hi Johan, what unit does it say is missing? It’ll be that there’s a directory missing from the path somewhere. I’ve found the following link helpful trying to resolve this kind of thing: http://wiki.lazarus.freepascal.org/Unit_not_found_-_How_to_find_units
Hi Mike,
I gave up on the lazarus install, i’m now trying out the codetyphon, this runs without any problems at my work system (winXP) and installed correctly under ubuntu 11.10, but I need to test this further.
Below is the link I used
http://www.pilotlogic.com/sitejoom/index.php/codetyphon-help
kind regards,
Johan