I have a complete script to install fpc-lazarus on Ubuntu and other debian base.
On the first run it will install all required app and libs, also setting any symlinks and paths needed. then sistem will restart.
On the next run it will download and update source and build them all.
Note: do Reset FPC to make sure everything run smoothly especially if have installed version of fpc greater than 2.6.4
Regard.