Recent

Author Topic: Installing Lazarus/FPC on Ubuntu - HowTo  (Read 28288 times)

Troodon

  • Sr. Member
  • ****
  • Posts: 484
Installing Lazarus/FPC on Ubuntu - HowTo
« on: December 05, 2011, 06:02:51 pm »
Over the last months several people have posted messages describing the difficulties they experienced upon trying to install Lazarus/FPC on Ubuntu. Below are the steps to follow to successfully install from .deb packages. If you choose to install from source then you are on you own and I assume that you know exactly what you are doing, therefore you don't need my instructions; keep in mind though that you will need to apply all updates from source, and possibly also some dependency upgrades which may or may not break the consistency of your Ubuntu (.deb) package tree.

Warning: Recent .deb packages may have been built for recent Ubuntu releases and may require dependencies that are only available for those Ubuntu releases.

To install the Lazarus/FPC .deb packages:

1. Install Ubuntu. Notice that Canonical recommend the 32-bit release (hint!).

2. Apply all Ubuntu software updates.

3. Install the lazarus meta-package (a meta-package only contains a list of packages that "work together"). It is very important that you do not skip this step as it will install all the required dependencies (tons of them). In Ubuntu 11.* you can use whatever .deb package manager you want but I recommend Synaptic (if it's not already installed then open a Terminal window and run: sudo apt-get install synaptic).

4. Launch Lazarus from the Applications menu and verify that it runs as expected. Open the environment preferences and customize it as you like. It is a good idea to choose a temporary folder located in you home folder, rather than the default /tmp folder.

5. If you are unhappy with the installed version and want to upgrade to the latest stable packages then visit the SF archive (e.g., http://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20i386%20DEB/Lazarus%200.9.30.2/) and download the .deb.tar files to your Downloads folder and untar them; move all .deb files to one folder. You may wish to delete/move to another folder any Qt-related .deb files (you can install them later if necessary), particularly if the Qt framework is not installed on your Ubuntu machine. Uninstall all lazarus*, fpc*, and fp-* packages (but not the dependencies) using Synaptic. Then open a Terminal window in the folder where the .deb files are and issue: sudo dpkg -i *.deb (assuming there are no other .deb files in that folder). This will upgrade your Lazarus/FPC packages, including the link in the Ubuntu Applications menu. Note: Do not install a daily snapshot unless you know that a specific bug that is preventing your Lazarus/FPC application from running as expected has been fixed in the daily snapshot.

6. Launch Lazarus from the Applications menu and verify that it runs as expected. If it does not and you want to revert to the previous version then you need to (a) uninstall all lazarus*, fpc*, and fp-* packages (but not the dependencies) using Synaptic; and (b) go to step 3. Before you uninstall you may wish to try deleting the .lazarus folder in your home folder (you need to enable View Hidden Files in the file manager Preferences to see it) then launch Lazarus again and see if the problem persists.


If you want to install/remove Lazarus component packages (.lpk; not the same as Ubuntu .deb packages!) then you must launch Lazarus as superuser; in a Terminal window issue: sudo start-lazarus. You do not need to (and should not) change any file permissions in /usr or elsewhere to install Lazarus packages.

If at some point you do want to install from source I recommend that you first uninstall any installed Lazarus/FPC .deb packages (see step 6 above).

Like other Gnome/Gtk+ applications, the current Lazarus/FPC release does not integrate very well with the Unity interface in Ubuntu 11.*. There are workarounds posted to this forum that address these issues. However, I think Unity is still work in progress, it targets mainly tablet users, and good integration with future Ubuntu releases will require efforts from both Canonical and Lazarus developers. On the other hand, Lazarus/FPC is remarkably fast and stable on Ubuntu 10.04 LTS and 10.10. It also runs great on the latest RHEL-based distros such as Linux Scientific 6.1. All of these are very stable releases.

Cheers!
« Last Edit: December 14, 2011, 02:29:25 am by Troodon »
Lazarus/FPC on Linux

HappyLarry

  • Full Member
  • ***
  • Posts: 151
Re: Installing Lazarus/FPC on Ubuntu - HowTo
« Reply #1 on: December 11, 2011, 04:34:01 pm »
A summary like this is very helpful. A few questions:

1. On step 5, should you not uninstall the previous version of Lazarus (and possibly Free Pascal) before installing the later version?

2. Also on step 5, when you install a later version of Lazarus, you will probably first need to install a later version of Free Pascal. Free Pascal installation involves two steps
- installing the Free Pascal compiler and
- installing the Free Pascal 'sources' - fpsource.
The link you give has only 2 files -  Lazarus and the Free Pascal compiler. How would a user go about installing the fp-source and where would they find this file?

3. Also on step 5, I think that Free Pascal needs to be installed before Lazarus.
Use Lazarus and Free Pascal and stand on the shoulders of giants . . . very generous giants. Thank you.

Troodon

  • Sr. Member
  • ****
  • Posts: 484
Re: Installing Lazarus/FPC on Ubuntu - HowTo
« Reply #2 on: December 11, 2011, 05:29:37 pm »
On Ubuntu, running dpkg with the -i option is similar to running rpm -Uvh on rpm-based Linux systems: it will update/upgrade packages that are already installed and will install the new packages. Therefore, you may uninstall previous versions of Lazarus and FPC, if you wish to do so, but that is not necessary as they will be upgraded automatically.

Each Lazarus release is matched to a FreePascal release. The .debs at SF contain everything that is required so you don't need to upgrade/install FreePascal, the compiler or the source, separately.

Re your last question, the instructions I provided require that all untarred .deb files be in the same folder, sorry if I didn't make that more clear (I have just edited the instructions for clarity). After untarring the two downloaded .tar files, .deb files end up in two different folders, one for Lazarus and another one for FreePascal. All .deb files must be copied to the same folder prior to running dpkg -i *.deb otherwise the upgrade will not be successful.
« Last Edit: December 11, 2011, 05:46:11 pm by Troodon »
Lazarus/FPC on Linux

HappyLarry

  • Full Member
  • ***
  • Posts: 151
Re: Installing Lazarus/FPC on Ubuntu - HowTo
« Reply #3 on: December 11, 2011, 09:54:07 pm »
Thank you.

The link you give on SourceForge contains two files
-lazarus-0.9.30.2.i386.deb.tar
-fpc-2.4.4.1i386.deb
The first would be the new Lazarus version, the second the new Free Pascal version.

I presume that you would have to install both. The question is - does the second download fully install Free Pascal so that Lazarus can use it.

According to the wiki:http://wiki.lazarus.freepascal.org/Installing_Lazarus
Quote
Lazarus 0.9.30.2 requires fpc (Free Pascal) version 2.4.4 or higher and it requires both the compiled fpc libs (binaries) and the fpc sources and of the same version.

Are you saying that the file mentioned above installs both of the items mentioned in the quote?

When I installled Lazarus on Ubuntu 10.04  I had to install both items separately -  Lazarus didn't run otherwise. However, I didn't use the file above. I used fpc-2.4.4.i386-linux.tar, also from SourceForge, which came with its own install script.

Regards.


Use Lazarus and Free Pascal and stand on the shoulders of giants . . . very generous giants. Thank you.

Troodon

  • Sr. Member
  • ****
  • Posts: 484
Re: Installing Lazarus/FPC on Ubuntu - HowTo
« Reply #4 on: December 12, 2011, 01:18:18 am »
I presume that you would have to install both. The question is - does the second download fully install Free Pascal so that Lazarus can use it.
Are you saying that the file mentioned above installs both of the items mentioned in the quote?

Yes and yes. You mean, the files, one .tar for Lazarus and another one for FreePascal. But again, you must begin by installing the lazarus metapackage using Synaptic.
« Last Edit: December 12, 2011, 01:22:16 am by Troodon »
Lazarus/FPC on Linux

HappyLarry

  • Full Member
  • ***
  • Posts: 151
Re: Installing Lazarus/FPC on Ubuntu - HowTo
« Reply #5 on: December 12, 2011, 10:28:43 pm »
Nearly finished! One final question:

Suppose that the Lazarus version in the Ubuntu repository is Lazarus 0.9.28 but I want Lazarus 0.9.30.
- I should first install Lazarus 0.9.28 from the repository (using Synaptic).
- If it works, I should download the two .deb files from SourceForge (above)
- I should install them using dpkg -i *.deb.

Is this correct?

I think your instructions are excellent. They would have greatly helped me when I struggled a few weeks ago. Judging by this forum, they would greatly help a large number of other fellow Ubuntunistas too.

It would be great if you could produce a new Lazarus wiki page and altered the wiki page above (which is the most used at present) to refer to it.

Cheers





Use Lazarus and Free Pascal and stand on the shoulders of giants . . . very generous giants. Thank you.

Troodon

  • Sr. Member
  • ****
  • Posts: 484
Re: Installing Lazarus/FPC on Ubuntu - HowTo
« Reply #6 on: December 13, 2011, 01:37:09 am »
Is this correct?

The two .deb.tar files ;) Yes.

Judging by this forum, they would greatly help a large number of other fellow Ubuntunistas too.

It's the reason why I posted them, I am glad I could help.

It would be great if you could produce a new Lazarus wiki page and altered the wiki page above (which is the most used at present) to refer to it.

That's not up to me.
« Last Edit: December 13, 2011, 01:44:15 am by Troodon »
Lazarus/FPC on Linux

maf

  • Newbie
  • Posts: 1
Re: Installing Lazarus/FPC on Ubuntu - HowTo
« Reply #7 on: December 13, 2011, 12:48:26 pm »
OK I did everything (hopefully the right way) but then the new lazarus (0.9.30 after the upgrade using the debs) won't start. The link on the menu has no icon and when i click on it opens that lazarus initial splash screen with a window with error:

"Can't find the lazarus executable /usr/lib/lazarus/0.9.30.2/lazarus".

Any idea?

runing ub 11.04 with gnome classic (no effects).


Troodon

  • Sr. Member
  • ****
  • Posts: 484
Re: Installing Lazarus/FPC on Ubuntu - HowTo
« Reply #8 on: December 13, 2011, 03:04:06 pm »
The new .deb packages for lazarus seem to be built on a recent Ubuntu system. The bad news is, these lazarus 0.9.30.2 .deb packages cannot be installed on Ubuntu 10.10 or older due to unsatisfied dependencies. This is disappointing but it's consistent with the "Linux attitude" re backward compatibility. If you do try installing them then some packages will be installed and some will not, and you will end up with a broken package system and you will not be able to start Lazarus; you will need to uninstall all laz*, fpc*, and fp-* packages using Synaptic and revert to the previous release (step 6 above).

The error message you got in Ubuntu 11.04 is identical to the one I got in Ubuntu 10.10, therefore I assume that the new .deb packages are built for 11.10.

Now, this is interesting. Ubuntu 11.10 comes with lazarus-0.9.30-2build1 and fpc-2.4.4-2ubuntu1 and, upon attempting to install the most recent .debs from SorceForge, I am warned that lazarus and fpc will be downgraded. To avoid any unpleasant surprises I first uninstalled Lazarus/FPC using Synaptic. Then I issued sudo dpkg -i *.deb in the folder where the new .debs are. Launching Lazarus 0.9.30.2 from the Applications menu was successful.

In conclusion, the Lazarus/FPC .debs available at SF seem to be built on/for a recent Ubuntu release and it may be impossible to install them as such on older Ubuntu releases. IMO this is no big deal as one can easily download the latest Ubuntu and install it in VirtualBox.
« Last Edit: December 15, 2011, 12:20:45 am by Troodon »
Lazarus/FPC on Linux

mdalacu

  • Full Member
  • ***
  • Posts: 209
    • dmSimpleApps
Re: Installing Lazarus/FPC on Ubuntu - HowTo
« Reply #9 on: April 25, 2012, 01:50:36 pm »
It works installing lazarus 0.9.30.4 with fpc 2.6.0 in Ubuntu 12.04 from lazarus-stable repository (http://wiki.freepascal.org/Lazarus_release_version_for_Ubuntu).

Bruce Mayo

  • Newbie
  • Posts: 2
Re: Installing Lazarus/FPC on Ubuntu - HowTo
« Reply #10 on: May 16, 2012, 10:21:17 pm »
On Unbuntu 10.4, which I just updated, using Synaptic to install the lazarus meta-package, I get the "unresolvable dependencies" message with "lazarus:  Depends: lazarus-0.9.30.4 but it is not going to be installed". Any chance this will be fixed, or should I just move on to Ubuntu 12.04? Or can I revert to an earlier meta-package?

braximo

  • Jr. Member
  • **
  • Posts: 79
Re: Installing Lazarus/FPC on Ubuntu - HowTo
« Reply #11 on: May 17, 2012, 11:46:56 am »
Im also having lots of problems installing laz on the unity interface. My apps that works with gnome are having unpleasantries with unity(lazreports). There are work-arounds in installing 0.9.30.04 with lucid but with pangolin, hmmm... only from the link given above...
Ubuntu 16.04 Lazarus 1.6

hihat

  • Newbie
  • Posts: 1
Re: Installing Lazarus/FPC on Ubuntu - HowTo
« Reply #12 on: May 19, 2012, 06:21:41 am »
hi anyone can help me here?
i want to install freepascal that have interface like Turbo Pascal
how to do that?
thanks

 

TinyPortal © 2005-2018