[Update: this post was from May 2011 for Ubuntu 10, for Ubuntu 11 see here]
I tried updating apt sources with “deb http://www.hu.freepascal.org/lazarus/ lazarus-stable universe” but got an error:
Failed to fetch http://www.hu.freepascal.org/lazarus/dists/lazarus-stable/Release Unable to find expected entry ‘universe/source/Sources’ in Release file (Wrong sources.list entry or malformed file)
I tried checking out the daily source from SVN but couldn’t work out how to make it all build properly. I tried the daily downloads of deb packages but got an error on starting that said “LCLBase 1.0″ – “Unit not found: RegisterLCL” error.
I tried downloading various archives full of stuff and either making, installing debs or whatever with a variety of problems. Often there were broken package dependencies around e(.g. “package lcl-units-0.9.30 is not installed”).
Finally I found a way that worked over the weekend so I thought I’d share it for others having these difficulties. First if you’ve got a corrupt/broken installation or an old version installed it’s a good idea to get rid of it. I did this by doing:
1. Delete any existing FPC and Lazarus stuff, conflicts between versions are the source of many of the problems!
sudo apt-get purge fpc lazarus*
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
2. Download and extract the fpc packages (although at time of writing the ones packaged with ubuntu 11.10 are good enough – 22/10/11) and the latest lazarus packages. This ends up with two folders full or .deb files. Going into the fpc one first, then the lazarus one and entering:
sudo dpkg -i *
Installs FPC and then Lazarus.
3. Finally run Lazarus from your main menu, weird unity thingy or whatever you use
Yeah, that worked
This saved me a great deal of time, thanks!
(fpc packages link seems to be wrong, plus obviously pay attention if you need a 32 or 64 bit package)
Thanks!
Francesco
Glad to have helped