Installing Lazarus/Free Pascal on Linux.
Concerning this document, please note the following:
|
|
Installing Lazarus on Ubuntu 18.04 LTS. | |
First, you should update the package list for your operating system. Open a terminal and type: sudo apt-get update Preceding a command by "sudo", gives you superuser (root) rights (and you will have to enter your Ubuntu user's password). apt-get is the name of the AptGet command line program. The parameter "update" tells "aptitude" to update the package information. |
|
|
|
To install a given package, you need to know the exact package name. Use one of the following commands to search for a package name: apt-cache search <search_term> dpkg -l *<search_term>* Both commands list all available packages whose name or description contains <search_term>. The second one also shows whether a package is installed on your system by marking it with "ii" (installed) or "un" (not installed). A detailed description of apt-get may be found in the AptGet HowTo of the Ubuntu Community Help Wiki. |
|
To install Lazarus 1.8 on Ubuntu, type the following in the terminal: sudo apt-get install lazarus-1.8 AptGet lists all new packages to be installed, as well as those that have to be upgraded, those that have to be removed and those that could optionally be installed. Answering "y" (default option) to the question "Do you want to continue?" will launch the download and install process, all automatically and when finished, your new Lazarus should be installed and ready to use. |
|
|
|
|
|
|
|
The installation process has created a shortcut to start the Lazarus IDE. You'll find it by clicking the "Applications" icon in the favorite bar of the Ubuntu dash and then searching for Lazarus. The version actually installed on my system is Lazarus 1.8.2 (64bit). | |
|
|
Exactly as on Windows, when starting Lazarus for the first time, a window pops up, where you may configure it, i.e. set the paths to compiler, make, debugger.... Check if all components have been found; this should normally be the case. | |
|
|
After pushing "Start IDE", Lazarus opens with a new "application" project. You may want to rearrange the different windows present and add other ones (using the "View" menu). Object Inspector, Source editor and Messages windows should always be visible and easily accessible. | |
|
|
Installing Lazarus on Ubuntu 20.04 LTS. | |
With the actual (January 2022) LTS version, AptGet installs Lazarus 2.0.6. I encountered some problems, no idea if due to the new Ubuntu version, to the
installed Lazarus version, or to the fact that I run Ubuntu on a VMware virtual machine.
|
|
Installing Lazarus on older versions of Ubuntu. | |
As I said above, trying to install the most recent version of a software package on an older Linux operating system may be tricky and even impossible. The simplest way is just to use the package with the version expected by the OS. And on Ubuntu, the simplest way to be sure that all dependencies are installed and upgraded without breaking other dependencies, is to use AptGet. | |
Installing Lazarus on my Bio-Linux 8 (based on Ubuntu 14.04 LTS) with the command sudo apt-get install lazarus set up Lazarus version 1.0.10. An old version of course, but running properly and properly building several of the projects that I developed with Lazarus 1.8.4 on Windows 10. For others, some changes of the code are necessary, because, for example, the properties and methods of a given object do not exist (or are differently called) in the old Lazarus version. |
|
Write once, compile anywhere? | |
This is what Lazarus and Free Pascal strives for. The reality seems to be somewhat different. I had no problems to build the projects, developed on Windows on Ubuntu, but running them was not always possible resp. produced an unproper output. I suppose that some units, working on Windows, do not work on Linux and I also suspect that some objects and methods (especially when used with default settings) behave differently. Thus, if you intend to develop Lazarus applications intended to run on several platforms, be sure to have a closer look at related articles in the Lazarus/Free Pascal documentation, as well as testing them on all the platforms to be considered. |
If you find this text helpful, please, support me and this website by signing my guestbook.