Sign in Join
Wiki copytemporary

Installing Lazarus on Linux: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## Introduction
22
3-This page is about installing FPC and Lazarus on a Linux system. Its intended for new and 'regular' users, it does not cover some very advanced methods and concentrates on current releases. Linux users should think of FPC and Lazarus as being two distinct but related processes, FPC does not change much, on the other hand, you will probably want to update your Lazarus install or perhaps install multiple Lazarus versions. Mixing the install methods, especially after V2.0 may cause problems so please read carefully.
3+This page is about installing FPC and Lazarus on a Linux system. Its intended for new and 'regular' users, it does not cover some very advanced methods and concentrates on current releases. Linux users should think of FPC and Lazarus as being two distinct but related processes, FPC does not change much, on the other hand, you will probably want to update your Lazarus install or perhaps install multiple Lazarus versions. Mixing the install methods, especially after V2.0 may cause problems so please read carefully.
44
55**Notes about terms used on this page -**
66
7-- *We refer to various downloadable files such as **fpc_something** - you should replace the 'something' with whats appropriate for your system, for example, early 2019 using a DEB based 64bit distro it might be **fpc-laz_3.0.4-1_amd64.deb**. Mid 2021 lazarus-something.deb is **lazarus-project_2.0.12-0_amd64.deb**.*
8-- ***Package Manager** means a range of things on different different Linux systems. While we give command line examples, thats just because its easier to write. You will get the same result if you use your favourite GUI Tool such as **Synaptic**, **Ubuntu Software Centre** or **YaST2**. Maybe try double clicking on a downloaded package in your file manager.*
9-- *What ever Package manager tool you use, make sure you are using one that resolves **dependencies** (that is, it also installs thing that are required by the main package you are installing), most GUI apps do. You should avoid using tools like dpkg or rpm and instead use apt or yum depending on your flavour of Linux.*
7+ * _We refer to various downloadable files such as**fpc_something** \- you should replace the 'something' with whats appropriate for your system, for example, early 2019 using a DEB based 64bit distro it might be **fpc-laz_3.2.2-1_amd64.deb**. Mid 2025 lazarus-something.deb is **lazarus-project_4.0-0_amd64.deb**._
8+ * _**Package Manager** means a range of things on different different Linux systems. While we give command line examples, thats just because its easier to write. You will get the same result if you use your favourite GUI Tool such as **Synaptic** , **Ubuntu Software Centre** or **YaST2**. Maybe try double clicking on a downloaded package in your file manager._
9+ * _What ever Package manager tool you use, make sure you are using one that resolves**dependencies** (that is, it also installs thing that are required by the main package you are installing), most GUI apps do. You should avoid using tools like dpkg or rpm and instead use apt or yum depending on your flavour of Linux._
1010
1111## Required Linux packages
1212
13-According to forum member "MarkMLl", required Debian packages for Lazarus are:
13+Not withstanding the rather intimidating list below here, its most likely you will need to install only a few packages, they will bring along what is needed.
1414
15-- build-essential
16-- gdb (see below)
17-- libgpm-dev (formerly libgpmg1-dev)
18-- libncurses5-dev
19-- libncursesw5-dev
15+ * A **gtk2** debian based install - libx11-dev and libgtk2.0-dev.
16+ * A gtk2 rpm based install - libX11-devel and gtk2-devel.
17+ * A gtk2 pacman based install - gtk2 libx11.
18+ * A **Qt5** debian based system - libqt5pas-dev (but with a current Lazarus, your repo one may not be suitable <https://wiki.freepascal.org/Qt5_Interface#libqt5pas>).
19+ * A Qt5 rpm based install - qt5pas-devel (but with a current Lazarus, your repo one may not be suitable <https://wiki.freepascal.org/Qt5_Interface#libqt5pas>).
20+ * A Qt5 pacman based system - qt5pas, your repo one will probably be OK.
21+ * A **Qt6** system similar to Qt5, just change 5 to 6.
22+ * A **gtk3** system will need libgtk-3-dev or similar.
2023
21-Additionally, some distribution may also require appmenu-gtk2-module. If you find starting Lazarus has a 20 odd second delay, do try this additional package. Seems to be a particular problem on Ubuntu.
24+Find installation scripts at the <https://github.com/LongDirtyAnimAlf/fpcupdeluxe/tree/master/installscripts> for these OSes:
2225
26+ * Alpine Linux
27+ * ArchLinux
28+ * Debian (and Ubuntu)
29+ * Fedora
30+ * Oracle Linux
31+ * SUSE Linux
32+
33+The full list (for Gtk2, Qt5, Qt6) for Debian-based OS is listed in the script "debian.sh" here: <https://github.com/LongDirtyAnimAlf/fpcupdeluxe/blob/master/installscripts/debian.sh> . Here is the current content of that script:
34+```
35+sudo apt-get install -y xterm
36+ sudo apt-get install -y git
37+ sudo apt-get install -y subversion
38+ sudo apt-get install -y unzip
39+ sudo apt-get install -y wget
40+ sudo apt-get install -y make
41+ sudo apt-get install -y gcc
42+ sudo apt-get install -y build-essential
43+ sudo apt-get install -y binutils
44+ sudo apt-get install -y gdb
45+ sudo apt-get install -y libc6-dev
46+ sudo apt-get install -y libc-bin
47+ sudo apt-get install -y texinfo
48+
49+ sudo apt-get install -y libglib2.0-dev
50+ sudo apt-get install -y libgtk2.0-0-dev
51+ sudo apt-get install -y libgtk2.0-dev
52+ sudo apt-get install -y gtk2-engines-pixbuf
53+ sudo apt-get install -y libcairo2-dev
54+ sudo apt-get install -y libXxf86vm-dev
55+ sudo apt-get install -y libxtst-dev
56+ sudo apt-get install -y libx11-dev
57+ sudo apt-get install -y libglvnd-dev
58+
59+ sudo apt-get install -y appmenu-gtk2-module
60+ sudo apt-get install -y libcanberra-gtk-module
61+
62+ sudo apt-get install -y libxft2
63+ sudo apt-get install -y libfontconfig1
64+
65+ sudo apt-get install -y libsdl2-dev
66+ sudo apt-get install -y libsdl2-image-dev
67+ sudo apt-get install -y libsdl2-mixer-dev
68+ sudo apt-get install -y libsdl2-net-dev
69+ sudo apt-get install -y libsdl2-ttf-dev
70+
71+ sudo apt-get install -y qt5-qmake
72+ sudo apt-get install -y qtbase5-dev
73+ sudo apt-get install -y qtbase5-dev-tools
74+ sudo apt-get install -y qtdeclarative5-dev
75+ sudo apt-get install -y libqt5x11extras5-dev
76+
77+ sudo apt-get install -y qt6-base-dev
78+ sudo apt-get install -y qt6-base-dev-tools
79+```
80+
81+Some distribution may require appmenu-gtk2-module. If you find starting Lazarus has a 20 odd second delay, do try this additional package. Seems to be a particular problem on Ubuntu.
82+
2383### Debugger
2484
25-Linux (and Windows) users on Intel or AMD processors can use FPDebug backend (or, more correctly, FPDebug internal Dwarf-Debugger) and for most users that's a good choice. It's reported to be faster and in some respects, more feature rich than gdb. And it's bundled in with Lazarus.
85+Linux (and Windows) users on Intel or AMD processors can use FPDebug backend (or, more correctly, FPDebug internal Dwarf-Debugger) and for most users that's a good choice. It's reported to be faster and in some respects, more feature rich than gdb. And it's bundled in with Lazarus.
2686
27-If it's not auto selected (perhaps because you also have gdb installed), in Lazarus, Tool-\>Options-\>Debugger-\>Debugger-Backend. Click the "Change Type" button and select "FPDebug internal Dwarf-Debugger".
87+If it's not auto selected (perhaps because you also have gdb installed), in Lazarus, Tool->Options->Debugger->Debugger-Backend. Click the "Change Type" button and select "FPDebug internal Dwarf-Debugger".
2888
29-Other platforms, or perhaps users with specific needs ( see <https://forum.lazarus.freepascal.org/index.php/topic,55131.msg417949.html#msg417949> ) will need to stick with gdb.
89+Other platforms, or perhaps users with specific needs ( see <https://forum.lazarus.freepascal.org/index.php/topic,55131.msg417949.html#msg417949> ) will need to stick with gdb.
3090
3191## Make a Choice
3292
33-You do need to decide, early on, where you will be getting your Lazarus install from. You can, at any stage change your mind but at the cost of some backtracking. We don't recomend you get your FPC and Lazarus install kits from different places, its sometimes possible but sometimes unreliable. Broadly, your choices are -
93+You do need to decide, early on, where you will be getting your Lazarus install from. You can, at any stage change your mind but at the cost of some backtracking. We don't recommend you get your FPC and Lazarus packages from different places. However, any (appropriate version) package installed FPC will always build Lazarus from source. Broadly, your choices are -
3494
35-- Use your **Package Manager** to install both FPC and Lazarus. This means you are locked into the version of Lazarus that your distribution maintainers offer. Due to distro and Lazarus release cycles being out of sync, at any one time, its unlikely that your distribution will have the latest release of Lazarus. And many users do find those new releases attractive. You can install only one version of Lazarus under this model. But on the other hand, using the package manager approach is very easy and probably suits casual users.
95+ * Use your **Package Manager** to install both FPC and Lazarus. This means you are locked into the version of Lazarus that your distribution maintainers offer. Due to distro and Lazarus release cycles being out of sync, at any one time, its unlikely that your distribution will have the latest release of Lazarus. And many users do find those new releases attractive. You can install only one version of Lazarus under this model. But on the other hand, using the package manager approach is very easy and probably suits casual users.
3696
37-- Use the pre compiled packages (both FPC and Lazarus) made available by the FPC/Lazarus Team at **SourceForge**. Here you will find a wide choice of matched versions but you can only install one version at a time. The install process is still very easy ! This is possibly the best bet for new users.
97+ * Use the pre compiled packages (both FPC and Lazarus) made available by the FPC/Lazarus Team at **SourceForge**. Here you will find a wide choice of matched versions but you can only install one version at a time. The install process is still very easy ! This is possibly the best bet for new users.
3898
39-- Install FPC from either your Package Manager or SourceForge and then download the Lazarus **source code and compile** it yourself. May take a touch longer but is almost as easy and you do end up with the ability to add extra Lazarus installs, perhaps a 'production' version and a version based on the next release candidate. Or an old version to work on legacy code. In addition, you can easily make your own changes to the Lazarus Component Library, maybe just debug statements, maybe additional features you can feed back to help improve Lazarus further.
99+ * Install FPC from either your Package Manager or SourceForge and then download the Lazarus **source code and compile** it yourself. May take a touch longer but is almost as easy and you do end up with the ability to add extra Lazarus installs, perhaps a 'production' version and a version based on the next release candidate. Or an old version to work on legacy code. In addition, you can easily make your own changes to the Lazarus Component Library, maybe just debug statements, maybe additional features you can feed back to help improve Lazarus further.
40100
41-- Use **FPCUPdeluxe** - it can install a range of versions of both FPC and Lazarus for you without requiring you to understand the underlying structure.
101+ * Use **FPCUPdeluxe** \- it can install a range of versions of both FPC and Lazarus for you without requiring you to understand the underlying structure.
42102
43103### The Package Manager Model
44104
45-If you are happy with the versions offered by your distribution this might be the way to go. Almost all Linux distributions come with some sort of Package Manager, you are probably familiar with your's. Between then, the DEB and RPM based package systems represent much of the Linux community. And if you soon run into the limitations of this model, your package manager will help you back out again. But first, check the version available. Look up 'lazarus' in your GUI Package Manager or do -
46-
47-``` pascal
105+If you are happy with the versions offered by your distribution this might be the way to go. Almost all Linux distributions come with some sort of Package Manager, you are probably familiar with your's. Between then, the DEB and RPM based package systems represent much of the Linux community. And if you soon run into the limitations of this model, your package manager will help you back out again. But first, check the version available. Look up 'lazarus' in your GUI Package Manager or do -
106+```
48107// DEB Users -
49-apt-cache policy lazarus
50-
51-// RPM User -
52-yum search lazarus
108+ apt-cache policy lazarus
109+
110+ // RPM User -
111+ yum search lazarus
53112```
54113
55-Note the names as well as the versions, we need three packages, fpc-something, fpc-source-something and, finally lazarus_something. Assuming you distribution's package has its dependencies set up correctly, all you need do is choose to install Lazarus in either your Package Manage GUI or do:
56-
57-``` pascal
114+Note the names as well as the versions, we need three packages, fpc-something, fpc-source-something and, finally lazarus_something. Assuming you distribution's package has its dependencies set up correctly, all you need do is choose to install Lazarus in either your Package Manage GUI or do:
115+```
58116// DEB Users -
59-sudo apt-get install lazarus
60-
61-// RPM Users -
62-sudo yum install lazarus
63-
64-// or
65-sudo dnf install lazarus
117+ sudo apt-get install lazarus
118+
119+ // RPM Users -
120+ sudo yum install lazarus
121+
122+ // or
123+ sudo dnf install lazarus
66124```
67125
68126**Notes :**
69127
70-- Some distro prepared packages do not include the tools necessary to add cross compiling to its capabilities. If you may want to cross compile in the future, please consider one of the next listed models.
71-- Some distro package managers break Lazarus up in small 'chunks', by default you get the GTK2 chunks. If you plan to use Qt5 also install libqt5pas-dev and lcl-qt5. You can make Qt5 apps using the GTK2 IDE.
72-- If you plan to work with GTK3, you will need to install libgtk-3-dev, its not declared as a dependency of Lazarus yet because the GTK3 interface is not, yet, complete.
73-- If you use Debian Bullseye, you should consider getting Lazarus (2.2.0) from Bullseye-Backports, there is an annoying bug in the main repo version that affects IDE rebuilding. Other Debian based distros will probably pick up the Backport or Testing version and they will be fine.
128+ * Some distro prepared packages do not include the tools necessary to add cross compiling to its capabilities. If you may want to cross compile in the future, please consider one of the next listed models.
129+ * Some distro package managers break Lazarus up in small 'chunks', by default you get the GTK2 chunks. If you plan to use Qt5 also install libqt5pas-dev and lcl-qt5. You can make Qt5 apps using the GTK2 IDE.
130+ * If you plan to work with GTK3, you will need to install libgtk-3-dev, its not declared as a dependency of Lazarus yet because the GTK3 interface is not, yet, complete.
131+ * If you use Debian Bullseye, you should consider getting Lazarus (2.2.0) from Bullseye-Backports, there is an annoying bug in the main repo version that affects IDE rebuilding. Other Debian based distros will probably pick up the Backport or Testing version and they will be fine.
74132
75133### Debian-based 64-bit with Lazarus 32-bit
76134
77-On Debian system, like Ubuntu or Mint, run in terminal:
78-
79-```text
135+On Debian system, like Ubuntu or Mint, run in terminal:
136+```
80137sudo dpkg --add-architecture i386
81-sudo apt-get update
138+ sudo apt-get update
82139```
83140
84-And then install the FPC-Lazarus i386 deb-packages in right order:
85-
86-- fpc-laz first
87-- fpc-src next
88-- finally lazarus-project
141+And then install the FPC-Lazarus i386 deb-packages in right order:
89142
90-If you have error message like "cannot find GCC", then run in terminal:
143+ * fpc-laz first
144+ * fpc-src next
145+ * finally lazarus-project
91146
92-```text
147+If you have error message like "cannot find GCC", then run in terminal:
148+```
93149sudo apt-get install -y gcc:i386
94150```
95151
96152### FPC and Lazarus from SourceForge
97153
98-If your Package Manager cannot offer you the correct version of FPC then probably SourceForge can (The Raspberry Pi being a notable exception) (! But be prepared for your package manager to complain about being bypassed, just insist you know what you are doing !
99-
100-All packages can be found at <https://sourceforge.net/projects/lazarus/files/> , if you want just FPC, you will find it down in the corresponding Lazarus release directory.
154+If your Package Manager cannot offer you the correct version of FPC then probably SourceForge can (The Raspberry Pi being a notable exception) (! But be prepared for your package manager to complain about being bypassed, just insist you know what you are doing !
101155
102-Navigate down, select the appropriate packages, again, fpc_something, fpc-src_something and lazarus_something, save them locally and install. WARNING, very important, this catches many users out ! Like most Linux packages, these packages have dependencies, you must install using a tool that resolves dependencies. Commands like "dpkg -i fpc_something.deb" will, most definitely leave an incomplete installation !
156+All packages can be found at <https://sourceforge.net/projects/lazarus/files/> , if you want just FPC, you will find it down in the corresponding Lazarus release directory.
103157
104-Further, you might need to manually install gdb, the GNU debugger if you are not going to use fpdebug. A debugger is not absolutely essential but it makes life a lot easier. If you plan to work with GTK3, or Qt5 you will need to manually install libgtk-3-dev or libqt5pas-dev.
158+Navigate down, select the appropriate packages, again, fpc_something, fpc-src_something and lazarus_something, save them locally and install. WARNING, very important, this catches many users out ! Like most Linux packages, these packages have dependencies, you must install using a tool that resolves dependencies. Commands like "dpkg -i fpc_something.deb" will, most definitely leave an incomplete installation !
105159
106-**On a DEB based System.** On a older DEB based system, you almost certainly should use gdebi to install any downloaded DEB. It might already be installed, if not, install it first. You can use gdebi at the command line or double click a downloaded package in your file manager. But remember, most important, install first fpc, then fpc-src, then and only then, Lazarus. On more recent deb based systems, the apt command can resolve dependencies, you could then use this command (but note the **very important ./** in front of each deb file, if you don't specify the exact location of your downloaded deb file, it will go and get the repository based one) -
160+Further, you might need to manually install gdb, the GNU debugger if you are not going to use fpdebug. A debugger is not absolutely essential but it makes life a lot easier. If you plan to work with GTK3, or Qt5 you will need to manually install libgtk-3-dev or libqt5pas-dev.
107161
108-``` bash
162+**On a DEB based System.** On a older DEB based system, you almost certainly should use gdebi to install any downloaded DEB. It might already be installed, if not, install it first. You can use gdebi at the command line or double click a downloaded package in your file manager. But remember, most important, install first fpc, then fpc-src, then and only then, Lazarus. On more recent deb based systems, the apt command can resolve dependencies, you could then use this command (but note the **very important ./** in front of each deb file, if you don't specify the exact location of your downloaded deb file, it will go and get the repository based one) -
163+```
109164sudo apt install ./fpc_something.deb ./fpc-src_something.deb ./lazarus-something.deb
110165```
111166
112-in mid 2022 for example, you might download from <https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%202.2.2/> and move the files to a suitable place and then type -
167+in mid 2025 for example, you might download 3 files from <https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%204_0/> and move the files to a suitable place and then type -
113168
114-``` bash
115-sudo apt install ./fpc-laz_3.2.2-210709_amd64.deb ./fpc-src_3.2.2-210709_amd64.deb ./lazarus-project_2.2.0-0_amd64.deb
116-```
169+
117170
118-**On an RPM Based System** Installing downloaded packages at the command line as shown below. (Author is unaware of the GUI Package tool that does, in fact, resolve dependencies) -
171+```
172+sudo apt install ./fpc-laz_3.2.2-210709_amd64.deb ./fpc-src_3.2.2-210709_amd64.deb ./lazarus-project_4.0.0-0_amd64.deb
173+```
119174
120-``` bash
175+**On an RPM Based System** Installing downloaded packages at the command line as shown below. (Author is unaware of the GUI Package tool that does, in fact, resolve dependencies) -
176+```
121177// RPM Users -
122-yum localinstall fpc_something.rpm
123-yum localinstall fpc-src_something.rpm
124-yum localinstall lazarus-something.rpm
178+ yum localinstall fpc_something.rpm
179+ yum localinstall fpc-src_something.rpm
180+ yum localinstall lazarus-something.rpm
125181```
126182
127-Note : later RPM based systems use the **dnf** command instead of yum, same syntax.
183+Note : later RPM based systems use the **dnf** command instead of yum, same syntax.
128184
185+#### Installing on Linux Mint
186+
187+1\. Open <https://www.lazarus-ide.org/index.php?page=downloads>
188+
189+2\. Select the version appropriate for you frorm _DEB Releases_
190+
191+3\. Download and install the following packages in the _exact_ order:
192+
193+3.1. fpc-laz_*.deb
194+
195+3.2. fpc-src*.deb
196+
197+3.3. lazarus-project_*.deb
198+
199+4\. Execute the following commands in the console:
200+```
201+sudo groupadd fpcusers
202+ sudo usermod -aG fpcusers $USER
203+ sudo chgrp -R fpcusers /usr/lib/fpc /usr/share/lazarus
204+ sudo chmod -R g+rw /usr/lib/fpc /usr/share/lazarus
205+```
206+
207+5\. To reinstall, first uninstall _fpc*_ , _lazarus*_ and _fp-*_.
208+
209+
210+6\. Troubleshooting:
211+
212+6.1. On error _Debugger not found_ :
213+
214+_Main menu — Tools — Options — Debugger — Debugger backend — Change type_ and select something from the list.
215+
216+6.2. If modern look is not working (Lazarus 4.0 and above):
217+
218+_Main menu — Tools — Options — Environment — Docking/ Anchordocking_ and check _Enable docking on IDE Windows (Requires IDE Restart)_
219+
129220### Build Lazarus from Source
130221
131-Surprisingly easy, but that is because Lazarus routinely rebuilds itself, eg when a Lazarus package is added. So, its also a useful test that all required dependencies are really present. It allows you to have multiple versions of Lazarus installed ( [[Multiple Lazarus|see --pcp=xxx]] ) and both Lazarus and LCL are in your own disk space so no write issues. However, you will need to manually add an entry in your OS Menu system and, perhaps distinctive Lazarus icons.
222+Surprisingly easy, but that is because Lazarus routinely rebuilds itself, eg when a Lazarus package is added. So, its also a useful test that all required dependencies are really present. It allows you to have multiple versions of Lazarus installed ( [[Multiple Lazarus|see --pcp=xxx]] ) and both Lazarus and LCL are in your own disk space so no write issues. However, you will need to manually add an entry in your OS Menu system and, perhaps distinctive Lazarus icons.
132223
133-> **Note:** Remember, FPC and Lazarus are two, separate products. Before thinking about building Lazarus, you must have a working and tested FPC. Mid 2023 FPC 3.2.2 was what you probably should be using, many distributions will have it available, otherwise, you need to install it from one of the ways documented on [[Installing the Free Pascal Compiler]] .
224+![Light bulb](https://upload.wikimedia.org/wikipedia/commons/d/d8/Nuvola_apps_ktip.png) **Note:** Remember, FPC and Lazarus are two, separate products. Before thinking about building Lazarus, you must have a working and tested FPC. Mid 2023 FPC 3.2.2 was what you probably should be using, many distributions will have it available, otherwise, you need to install it from one of the ways documented on [[Installing the Free Pascal Compiler]] .
134225
135-> **Note:** Dependencies - First and foremost, a suitable version of FPC, see above. You probably want to build the GTK2 version of Lazarus, most distros will have gtk2 preinstalled but you may need to install its dev libraries. So, install libx11-dev and libgtk2.0-dev, that will bring gtk2 itself along if necessary. Possibly (see above) gdb. If building a QT5 version, you will need libqt5pas-dev. If you are going to work with GTK3, you will need to install libgtk-3-dev
226+![Light bulb](https://upload.wikimedia.org/wikipedia/commons/d/d8/Nuvola_apps_ktip.png) **Note:** Dependencies - First and foremost, a suitable version of FPC, see above. You probably want to build the GTK2 version of Lazarus, most distros will have gtk2 preinstalled but you may need to install its dev libraries. So, install libx11-dev and libgtk2.0-dev, (rpm based systems, libX11-devel, gtk2-devel) that will bring gtk2 itself along if necessary. Possibly (see above) gdb. If building a QT5 version, you will need libqt5pas-dev. If you are going to work with GTK3, you will need to install libgtk-3-dev
136227
137-> **Note:** Systems with limited memory, such as the **Raspberry Pi** may need you to increase swap space to at least a Gig before building Lazarus, RasPi page. See [[Lazarus on Raspberry Pi|Setting Raspberry Pi Swap Size]]
228+![Light bulb](https://upload.wikimedia.org/wikipedia/commons/d/d8/Nuvola_apps_ktip.png) **Note:** Systems with limited memory, such as the **Raspberry Pi** may need you to increase swap space to at least a Gig before building Lazarus, RasPi page. See [[Lazarus on Raspberry Pi|Setting Raspberry Pi Swap Size]]
138229
139-The example here pulls down what some consider 'brave', the trunk or main development version. The same process can get you releases, fixes or release candidates. Note this is not a script, it is a series of commands, to be copied one at a time, so you can see whats happening !
230+The example here pulls down what some consider 'brave', the trunk or main development version. The same process can get you releases, fixes or release candidates. Note this is not a script, it is a series of commands, to be copied one at a time, so you can see whats happening !
140231
141232#### Get the Lazarus Source
142233
143-There are two different ways to download the Lazarus Source (since August 2021) from gitlab, in fact there are several variations of each possible too) -
234+There are two different ways to download the Lazarus Source (since August 2021) from gitlab, in fact there are several variations of each possible too). Note, in all cases, here, we get a directory with the Lazarus source, build it and run it from that directory.
144235
145236**As a Zip/Tar ball.**
146237
147-If you just want a quick snapshot of trunk, or perhaps want to test the release candidate (and that a great idea) then you may not need access to the developer capabilities that a Git install provides. So, you don't need any git tools on your local machine and its quick and easy. While you can do it through the Gitlab web interface from <https://gitlab.com/freepascal.org/lazarus/lazarus> its easier to describe with command line tools, start by cd-ing to a suitable place, I use \$HOME/bin/Lazarus, then -
148-
149-```text
150-git clone https://gitlab.com/freepascal.org/lazarus/lazarus.git lazarus-main
151-cd lazarus-main
238+If you want to build a release Lazarus from source or just want a quick snapshot of trunk or fixes, or perhaps want to test the release candidate (and that is a great idea) then you may not need access to the developer capabilities that a Git install provides. So, you don't need any git tools on your local machine and its quick and easy. While you can do it through the Gitlab web interface from <https://gitlab.com/freepascal.org/lazarus/lazarus> its easier to describe with command line tools, start by cd-ing to a suitable place, I use $HOME/bin/Lazarus, then -
152239```
153-
154-**Some recommended downloads**
240+$> wget <https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/lazarus_4_0/lazarus-lazarus_4_0.zip>
241+ $> unzip lazarus-lazarus_4_0.zip
242+ $> mv lazarus-lazarus_4_0 lazarus_4_0
243+ $> cd lazarus_4_0
244+ $> make bigide
245+```
155246
156-- Current stable - lazarus_3_0 - <https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/lazarus_3_0/lazarus-lazarus_3_0.zip>
247+Now, see below for the section about Starting Lazarus to make it all work and look nice.
157248
158-- trunk, or as its now known, main. This is the default from gitlab - <https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/main/lazarus-main.zip>
249+**Some possible downloads**
159250
160-You can see all these options, and lot more on the gitlab site by pulling down the dropbox, left of center, near the top of the page.
251+ * Current stable - lazarus_4_0 - <https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/lazarus_4_0/lazarus-lazarus_4_0.zip>
161252
162-**As a Git repository.**
253+ * trunk, or as its now known, main. This is the default from gitlab - <https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/main/lazarus-main.zip>
163254
164-On the other hand, if you will be contributing patches, fixes, to Lazarus, or tracking down bugs by bisecting recent releases, then a proper git install is undoubtedly the way forward. You will need git installed locally, again, go to a suitable directory and:
255+
165256
166-```text
167-git clone https://gitlab.com/freepascal.org/lazarus/lazarus.git lazarus-main
168-cd lazarus-main
169-```
257+You can see all these options, and lot more on the gitlab site by pulling down the dropbox, left of center, near the top of the page.
170258
171-This is a bit slower process the first time, later you will use git to update it (run "git pull" from this folder "lazarus-main") and that's a lot faster. As bug reports must be tested against main, it probably does not make sense downloading git versions of anything other than main and maybe fixes.
259+**As a Git repository.**
172260
173-**Building Lazarus**
261+On the other hand, if you will be contributing patches, fixes, to Lazarus, or tracking down bugs by bisecting recent releases, then a proper git install is undoubtedly the way forward. You will need git installed locally, again, go to a suitable directory and:
262+```
263+git clone <https://gitlab.com/freepascal.org/lazarus/lazarus.git> lazarus-main
264+ cd lazarus-main
265+```
174266
175-Remembering that if you have less than 4G ram, you must set 1G or preferably 2G of swap.
267+This is a bit slower process the first time, later you will use git to update it (run "git pull" from this folder "lazarus-main") and that's a lot faster. As bug reports must be tested against main, it probably does not make sense downloading git versions of anything other than main and maybe fixes.
176268
177-``` bash
269+Remembering that if you have less than 4G ram, you must set 1G or preferably 2G of swap.
270+```
178271cd lazarus-main # or, where ever you have put your Lazarus source code
179-make clean
180-make bigide
272+ make clean
273+ make bigide
181274```
182275
183-You can now start Lazarus with the command ./lazarus or, if you are in another directory, something like -
276+**Starting Lazarus**
184277
185-``` bash
186-/home/[your-user-name]/bin/Lazarus/lazarus_2_2_6/lazarus
278+You can now start Lazarus with the command ./lazarus or, if you are in another directory, something like -
187279```
188-
189-You can add that directory to your path, put a script in ~/bin to start it or whatever, its Linux, you choose ! Here is an example script to put in your personal bin directory, note it includes FPC, if thats already on your path, leave that line out -
280+/home/[your-user-name]/bin/Lazarus/lazarus_3_6/lazarus
281+```
190282
191-``` bash
283+You can add that directory to your path, put a script in ~/bin to start it or whatever, its Linux, you choose ! Here is an example script to put in your personal bin directory, note it includes FPC, if thats already on your path, leave that line out -
284+```
192285#!/bin/bash
193-RELEASE="lazarus-main"
194-cd "$HOME/bin/Lazarus/""$RELEASE"
195-PATH="$HOME/bin/FPC/fpc-3.2.2/bin:""$PATH"
196-./lazarus --pcp="$HOME/.""$RELEASE"
286+ RELEASE="lazarus_4_0" # You will probably need to adjust this
287+ cd "$HOME/bin/Lazarus/""$RELEASE"
288+ PATH="$HOME/bin/FPC/fpc-3.2.2/bin:""$PATH" # don't need this if a package install of FPC
289+ ./lazarus --pcp="$HOME/.""$RELEASE"
197290```
198291
199-Out of the box, lazarus stores its config files in \$HOME/.lazarus - that might be all you need. But multiple installs require multiple config directories, thats why the --pcp switch on the command line. Alternatively, you can put a lazarus.cfg file in the top level Lazarus directory, where the lazarus binary is containing your chosen command line switch, this is a great way to ensure you don't mix up config data, lazarus does not like that !
292+Out of the box, lazarus stores its config files in $HOME/.lazarus - that might be all you need. But multiple installs require multiple config directories, thats why the --pcp switch on the command line. Alternatively, you can put a lazarus.cfg file in the top level Lazarus directory, where the lazarus binary is, containing your chosen command line switch, this is a great way to ensure you don't mix up config data, lazarus does not like that !
200293
201294#### Menu items and Icons
202295
203-Building from source leaves you without the nice main menu entries and pretty icons that people who installed using packages get. But even that is easy to fix. You need two things, a suitable icon and an appropriate desktop file. Here is how -
204-
205-First, download a Lazarus icon to use (its just an image, does not need to be from right version of Lazarus),
296+Building from source leaves you without the nice main menu entries and pretty icons that people who installed using packages get. But even that is easy to fix. You need two things, a suitable icon and an appropriate desktop file. Here is how -
206297
207-``` bash
298+First, download a Lazarus icon to use (its just an image, does not need to be from right version of Lazarus),
299+```
208300cd ~/.icons
209-wget https://gitlab.com/freepascal.org/lazarus/lazarus/-/raw/main/images/icons/lazarus256x256.png
210-cd -
301+ wget https://gitlab.com/freepascal.org/lazarus/lazarus/-/raw/main/images/icons/lazarus256x256.png
302+ cd -
211303```
212304
213-Then create a desktop file, eg ~/.local/share/applications/lazarus.desktop that looks a bit like this
214-
215-``` ini
305+Then create a desktop file, eg ~/.local/share/applications/lazarus.desktop that looks a bit like this
306+```
216307[Desktop Entry]
217-Name=Lazarus
218-GenericName=ide
219-Comment=ide
220-Exec=/home/myusername/bin/Lazarus/fixes_2_0/lazarus
221-Icon=/home/myusername/.icons/lazarus256x256.png
222-Terminal=false
223-Type=Application
224-Categories=Utility;Development;
308+ Name=Lazarus
309+ GenericName=ide
310+ Comment=ide
311+ Exec=/home/myusername/bin/Lazarus/fixes_2_0/lazarus
312+ Icon=/home/myusername/.icons/lazarus256x256.png
313+ Terminal=false
314+ Type=Application
315+ Categories=Utility;Development;
225316```
226317
227-You will almost certainly have to change some things and might want to change more -
318+You will almost certainly have to change some things and might want to change more -
228319
229-- **Name=** - This is what will appear in your main menu.
230-- **Exec=** - This is the path to your executable lazarus, in my case I keep my various installs in ~/bin/Lazarus, yours may be different. Its unlikely your user name is 'myusername' so please change it. Note you could add a --pcp command line switch as mentioned above. If you have multiple installs of Lazarus, make multiple desktop files and make sure each uses a separate set of config files. Most important ! You might like to point this item to the little bash script mentioned above, its an easy way of ensuring Lazarus gets the FPC path setting.
231-- **Icon=** The full path to the icon we downloaded earlier. The icon does not need be exactly there, but its a good place.
232-- **Categories=** This line determines which sub-menu Lazarus will show up under. As shown, its under "Programing" on my system, "GNOME;Utility" will pop it up under "Accessories".
320+ * **Name=** \- This is what will appear in your main menu.
321+ * **Exec=** \- This is the path to your executable lazarus, in my case I keep my various installs in ~/bin/Lazarus, yours may be different. Its unlikely your user name is 'myusername' so please change it. Note you could add a --pcp command line switch as mentioned above. If you have multiple installs of Lazarus, make multiple desktop files and make sure each uses a separate set of config files. Most important ! You might like to point this item to the little bash script mentioned above, its an easy way of ensuring Lazarus gets the FPC path setting.
322+ * **Icon=** The full path to the icon we downloaded earlier. The icon does not need be exactly there, but its a good place.
323+ * **Categories=** This line determines which sub-menu Lazarus will show up under. As shown, its under "Programing" on my system, "GNOME;Utility" will pop it up under "Accessories".
233324
234325#### Help Files
235326
236-FPC and Lazarus have quite a wide range of help files and related resources. When building Lazarus from source, you don't get the pre installed help chm that respond, for example, when you press F1. But they are easy to add, download a zip file into, typically, a directory called 'help'. Then, in Lazarus, Tools-\>Options-\>Help-\>Help_Options-\>CHM_Help_Viewer. Set Help Files Path to the directory you just put all the Chm files into. Get these files from here -
327+FPC and Lazarus have quite a wide range of help files and related resources. When building Lazarus from source, you don't get the pre installed help chm that respond, for example, when you press F1. But they are easy to add, download a zip file into, typically, a directory called 'help'. Then, in Lazarus, Tools->Options->Help->Help_Options->CHM_Help_Viewer. Set Help Files Path to the directory you just put all the Chm files into. Get these files from here -
237328
238-- If using Lazarus Main, <https://www.stack.nl/~marcov/doc-chmbeta.zip>
239-- If using a (recent) release, you might be better with <https://www.stack.nl/~marcov/doc-chm.zip>
329+ * <https://sourceforge.net/projects/lazarus/files/Lazarus%20Documentation/> (FPC and Lazarus in one file)
240330
241-These files are very kindly updated from time to time by Marcov. If you prefer, you can build your own in the source tree.
331+These files are very kindly updated from time to time by Marcov. If you prefer, you can build your own in the source tree.
242332
243-There are ways to access, possibly a newer version of the same data -
333+There are ways to access, possibly a newer version of the same data -
244334
245-- An on line version - <https://lazarus-ccr.sourceforge.io/docs/>
246-- A preview of the next release <https://dsiders.gitlab.io/lazdocsnext/> maintained by Don, thanks Don!
335+ * An on line version - <https://lazarus-ccr.sourceforge.io/docs/>
336+ * A preview of the next release <https://dsiders.gitlab.io/lazdocsnext/> maintained by Don, thanks Don!
247337
248338#### What does the `BigIDE` argument to `make` do?
249339
340+The _bigide_ `make` argument adds a bunch of packages to Lazarus that many find useful and cannot do without. The packages that are added are:
341+
342+ * cairocanvas
343+ * chmhelp
344+ * datetimectrls
345+ * externhelp
346+ * fpcunit
347+ * fpdebug
348+ * instantfpc
349+ * jcf2
350+ * lazcontrols
351+ * lazdebuggers
352+
353+|
354+
355+ * lclextensions
356+ * leakview
357+ * macroscript
358+ * memds
359+ * onlinepackagemanager
360+ * pas2js
361+ * PascalScript
362+ * printers
363+ * projecttemplates
364+ * rtticontrols
365+
366+|
367+
368+ * sdf
369+ * sqldb
370+ * synedit
371+ * tachart
372+ * tdbf
373+ * todolist
374+ * turbopower_ipro
375+ * virtualtreeview
376+
377+
378+---|---|---
379+
380+The above list is sourced from the _`[Lazarus source directory]/IDE/Makefile.fpc`_ and may be subject to change.
381+
382+Note that if you have not compiled your own Lazarus IDE with the _bigide_ argument, you can install any of these packages yourself using the Lazarus IDE [[IDE Window: Installed Packages|_Package > Install/Uninstall Packages..._]] dialog.
383+
250384### FPCUPdeluxe
251385
252-Another approach is [[fpcupdeluxe]], its an application that you run on your computer to manage your FPC / Lazarus install. Its very suited to people who just want to get a working install quickly and are happy to allow fpcupdeluxe to do the thinking for them.
386+Another approach is [[fpcupdeluxe]], its an application that you run on your computer to manage your FPC / Lazarus install. Its very suited to people who just want to get a working install quickly and are happy to allow fpcupdeluxe to do the thinking for them.
253387
254388## See Also
255389
256390### Other Relevant Pages
257391
258-- [[Installing the Free Pascal Compiler]]
259-- [[Cross compiling]]
260-- [[Cross Compile to RasPi from Linux]]
261-- Generic [[Installing Lazarus]]
262-- [[Lazarus on Raspberry Pi]]
263-- Install the help system, [[Installing Help in the IDE]]
264-- A number of useful additions but in particular Unit/Identifier Dictionary, [[Cody]].
265-- Some useful tricks associated with the IDE [[IDE tricks]]
392+ * [[Installing the Free Pascal Compiler]]
393+ * [[Cross compiling]]
394+ * [[Cross Compile to RasPi from Linux]]
395+ * Generic [[Installing Lazarus]]
396+ * [[Lazarus on Raspberry Pi]]
397+ * Install the help system, [[Installing Help in the IDE]]
398+ * A number of useful additions but in particular Unit/Identifier Dictionary, [[Cody]].
399+ * Some useful tricks associated with the IDE [[IDE tricks]]
266400
267401### Testing FPC installation
268402
269-See [[Installing the Free Pascal Compiler|Testing the FPC Install]] for a very simple test that FPC is working.
403+See [[Installing the Free Pascal Compiler|Testing the FPC Install]] for a very simple test that FPC is working.
270404
271-If that worked, well done ! Now proceed to installing Lazarus.
405+If that worked, well done ! Now proceed to installing Lazarus.
272406
273407## Further Reading
274408
275409Much discussion in a forum thread created by Handoko, <https://forum.lazarus.freepascal.org/index.php/topic,41524.0.html> This forum thread may be of particular interest to people who have upgraded an existing Linux install to a more recent version (ie Ubuntu 10.04 to 18.04) as that does seem to trigger some unexpected dependency problems. Please, ask for help, document such problems here when you fix them.
276410
277411---
278-*From the Free Pascal wiki, page "Installing Lazarus on Linux", as it stood on 2023-12-23 after a change by Alextpp, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
279-Category: FPC
280-Category: Install
281-Category: Lazarus
282-Category: Ubuntu
412+*From the Free Pascal wiki, page "Installing Lazarus on Linux", as the Internet Archive kept it on 2025-06-16, last changed on 2025-06-04. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history