Recent

Author Topic: How to Installation Lazarus 2.2.0 on linux mint?  (Read 5747 times)

Rama Can

  • New Member
  • *
  • Posts: 15
How to Installation Lazarus 2.2.0 on linux mint?
« on: March 22, 2022, 03:05:00 pm »
How to installation on Linux mint?
I always have problem when I install latest Lazarus on Linux Mint, can anyone help me with this for my college assignment

before I install, I first uninstalled Lazarus version 2.0.6
then download
fpc-laz_3.2.2_amd64.deb
fpc-src_3.2.2_amd64.deb
lazarus-project_2.2.0-0_amd64.deb

then i run this command in terminal

Quote
sudo dpkg -i fpc-laz_3.2.2_amd64.deb

sudo dpkg -i fpc-src_3.2.2_amd64.deb

sudo dpkg -i lazarus-project_2.2.0-0_amd64.deb

then get wrong

Quote
dpkg: regarding fpc-laz_3.2.2_amd64.deb containing fpc-laz:
 fpc-laz conflicts with fp-compiler
  fp-compiler:amd64 (version 3.0.4+dfsg-23) is present and installed.
  fp-compiler-3.0.4:amd64 provides fp-compiler and is present and installed.

dpkg: error processing archive fpc-laz_3.2.2_amd64.deb (--install):
 conflicting packages - not installing fpc-laz
Selecting previously unselected package fpc-src.
dpkg: regarding fpc-src_3.2.2_amd64.deb containing fpc-src:
 fpc-src conflicts with fpc-source
  fpc-source-3.0.4 provides fpc-source and is present and installed.

dpkg: error processing archive fpc-src_3.2.2_amd64.deb (--install):
 conflicting packages - not installing fpc-src
dpkg: warning: files list file for package 'dbconfig-common' missing; assuming package has no files currently installed
(Reading database ... 412251 files and directories currently installed.)
Preparing to unpack lazarus-project_2.2.0-0_amd64.deb ...
Unpacking lazarus-project (2.2.0) ...

dpkg: dependency problems prevent configuration of lazarus-project:
 lazarus-project depends on fpc-laz (= 3.2.2); however:
  Package fpc-laz is not installed.
 lazarus-project depends on fpc-src (= 3.2.2); however:
  Package fpc-src is not installed.

dpkg: error processing package lazarus-project (--install):
 dependency problems - leaving unconfigured
Processing triggers for bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu2) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.24+linuxmint1) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for shared-mime-info (1.15-1) ...
Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
 fpc-laz_3.2.2_amd64.deb
 fpc-src_3.2.2_amd64.deb
 lazarus-project
« Last Edit: March 22, 2022, 03:07:46 pm by ramacan »

nouzi

  • Sr. Member
  • ****
  • Posts: 328
Re: How to Installation Lazarus 2.2.0 on linux mint?
« Reply #1 on: March 22, 2022, 03:24:36 pm »
First remove old version

Code: Bash  [Select][+][-]
  1. apt remove fpc-laz*
  2. apt remove lazarus*
  3. apt autoremove &&  apt clean
  4.  

and try again

My English is  bad
Lazarus last version free pascal last version
Lazarus trunk  free pascal trunk 
System : Linux mint  64bit  Windows 7 64bit

Rama Can

  • New Member
  • *
  • Posts: 15
Re: How to Installation Lazarus 2.2.0 on linux mint?
« Reply #2 on: March 22, 2022, 03:49:11 pm »
still with the same error

Thaddy

  • Hero Member
  • *****
  • Posts: 18792
  • Glad to be alive.
Re: How to Installation Lazarus 2.2.0 on linux mint?
« Reply #3 on: March 22, 2022, 05:40:34 pm »
Not remove, but purge.
Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.

Rama Can

  • New Member
  • *
  • Posts: 15
Re: How to Installation Lazarus 2.2.0 on linux mint?
« Reply #4 on: March 22, 2022, 05:48:50 pm »
still with the same error :(

bytebites

  • Hero Member
  • *****
  • Posts: 778
Re: How to Installation Lazarus 2.2.0 on linux mint?
« Reply #5 on: March 22, 2022, 06:07:42 pm »
 fp-compiler-3.0.4:amd64 still exists.
apt-remove  fp-compiler-3.0.4:amd64

Thaddy

  • Hero Member
  • *****
  • Posts: 18792
  • Glad to be alive.
Re: How to Installation Lazarus 2.2.0 on linux mint?
« Reply #6 on: March 22, 2022, 06:35:55 pm »
apt  purge or apt-get purge if I was not clear. Apt needs to remove <~/home/user><hidden directories> as well.
it also needs to remove a config file at /etc
Simply calling remove is an error. Only purge removes almost everything. (almost: installation logs)
« Last Edit: March 22, 2022, 06:38:10 pm by Thaddy »
Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.

Handoko

  • Hero Member
  • *****
  • Posts: 5524
  • My goal: build my own game engine using Lazarus
Re: How to Installation Lazarus 2.2.0 on linux mint?
« Reply #7 on: March 22, 2022, 07:10:03 pm »
This is how I totally uninstall and remove the leftovers of the Lazarus installation on Ubuntu Mate:

01. Uninstall lazarus, fpc, fpc-src
02. Delete ~/.lazarus, except: editoroptions, environmentoptions
03. Delete /etc/fp.*
04. Delete /usr/share/fpcsrc
05. Delete /usr/lib/fpc
06. Delete /usr/bin/ppc*


Because I want to keep some Lazarus IDE settings so I do not delete the editoroptions and environmentoptions.

dbannon

  • Hero Member
  • *****
  • Posts: 3741
    • tomboy-ng, a rewrite of the classic Tomboy
Re: How to Installation Lazarus 2.2.0 on linux mint?
« Reply #8 on: March 22, 2022, 11:41:16 pm »
A few comments.

Firstly, there 'should' be no reason other than mixed install models, why you need to uninstall/purge/nuke a previous install of fpc / lazarus.  Apt will overwrite everything it needs as long as the package name and contents names match.

Thaddy - purge does not remove content in $HOME

If installing a new Lazarus, even using a different model, Lazarus will detect and update the files in .lazarus if thats where your config goes. So, useful to make a clean start but not essential to nuke .lazarus even.

If you have had an old install, perhaps you are using Linux Mint based on the quite old Ubuntu 18.04 for example and then try and install the official ones from FPC/Lazarus then yes, vital you remove all existing FPC/Lazarus files at an operating system level. Apt 'should' be able to do it and purge is a good idea because it will remove config files (under /etc and /usr) as well. You can use apt purge even after a package has been 'removed'. Worth checking that $HOME/.fpc.cfg does not exist but its unlikely.

Finally, and very importantly, do not use dpkg to install packages. Its a low level tool called by other programs. Use apt (preferably not apt-get) because it will resolve dependencies (on all recent linuxes) and does do some sanity checking.  gdebi is a nice GUI if you prefer that sort of thing. But not dpkg.

So, take home message, trust apt unless you have been mixing install models.

Davo

PS : consider building Lazarus from source instead of from a deb. Especially on Linux !

https://wiki.freepascal.org/Installing_Lazarus


 

Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Rama Can

  • New Member
  • *
  • Posts: 15
Re: How to Installation Lazarus 2.2.0 on linux mint?
« Reply #9 on: March 24, 2022, 08:41:23 am »
so how to fix broken lazarus package?

I use the command

Quote
sudo apt install ./fpc-laz_3.2.0-1_amd64.deb  ./fpc-src_3.2.0-1_amd64.deb  ./lazarus-project_2.0.12-0_amd64.deb


*sorry if my english is not good
« Last Edit: March 24, 2022, 08:43:04 am by ramacan »

Handoko

  • Hero Member
  • *****
  • Posts: 5524
  • My goal: build my own game engine using Lazarus
Re: How to Installation Lazarus 2.2.0 on linux mint?
« Reply #10 on: March 24, 2022, 08:56:13 am »
If you have Lazarus installed previously, try to totally remove the previous installation, see reply #7.

Gdebi and Synaptic Package Manager can be helpful if you have problem installing Lazarus on Linux.

Also this thread have the information why the installation may failed on Ubuntu and its variants:
https://forum.lazarus.freepascal.org/index.php/topic,41524.0.html

dbannon

  • Hero Member
  • *****
  • Posts: 3741
    • tomboy-ng, a rewrite of the classic Tomboy
Re: How to Installation Lazarus 2.2.0 on linux mint?
« Reply #11 on: March 24, 2022, 09:10:08 am »
ramacan, looks like you have an existing install of 2.0.6 there, that must be quite old. A couple of people mentioned that an old broken install will cause you problems.

So, lets see if we can remove it, the fact that its not being taken care of by the install of the new one says its, somehow broken, maybe you removed some bit manually rather than using apt ?  Or installed from source ?  In future, better to use apt to remove anything installed with apt.

Anyway, your FPC is probably fine so leave it alone. Try these commands for interest sake  -

Code: Pascal  [Select][+][-]
  1. which lazarus <enter>
  2. which startlazarus <enter>

Now, lets get rid of ALL lazarus -
Code: Bash  [Select][+][-]
  1. apt purge lazarus <enter>
  2. which lazarus <enter>
  3. which startlazarus <enter>

If the second "which" commands gave us a result, you still have something there and apt does not know about it. So, I am afraid, you need to, as root, manually remove it. Only do this AFTER you have tried to remove lazarus with the apt command and failed.  Please be very careful.

Code: Bash  [Select][+][-]
  1. sudo rm -Rf  /usr/lib/lazarus   /usr/bin/lazarus

Now, try those "which" commands again, if you get a response, please copy the result here and we'll have another think. Maybe run these commands and post the result -

Code: [Select]
ls -l /etc/fpc.cfg
ls -l ~/.fpc.cfg
ls -l /usr/bin/laz*

Only when we are sure we don't have any residual broken Lazarus left should you try again to install the new one.  We may need to deal with some symlinks in /usr/bin ...

Don't worry ramacan, we will sort it out !  And your English is fine.

Davo






Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Rama Can

  • New Member
  • *
  • Posts: 15
Re: How to Installation Lazarus 2.2.0 on linux mint?
« Reply #12 on: March 24, 2022, 11:01:11 am »
I've done the command above, then what else? is it time to install again?

Quote
ram@ram-4G:~$ sudo sh -c "rm -Rf /etc/fp.* \
> rm -Rf /usr/share/fpcsrc \
> rm -Rf /usr/lib/fpc \
> rm -Rf /usr/bin/ppc*"
[sudo] password for ram:           
ram@ram-4G:~$ apt purge lazarus
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'lazarus' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.
ram@ram-4G:~$ which lazarus
ram@ram-4G:~$ which startlazarus
ram@ram-4G:~$ sudo rm -Rf  /usr/lib/lazarus   /usr/bin/lazarus
ram@ram-4G:~$ ls -l /etc/fpc.cfg
ls: cannot access '/etc/fpc.cfg': No such file or directory
ram@ram-4G:~$ ls -l ~/.fpc.cfg
ls: cannot access '/home/ram/.fpc.cfg': No such file or directory
ram@ram-4G:~$ ls -l /usr/bin/laz*
ls: cannot access '/usr/bin/laz*': No such file or directory
ram@ram-4G:~$

dbannon

  • Hero Member
  • *****
  • Posts: 3741
    • tomboy-ng, a rewrite of the classic Tomboy
Re: How to Installation Lazarus 2.2.0 on linux mint?
« Reply #13 on: March 25, 2022, 01:20:18 am »
Er, the first line you have posted there was definitely NOT suggested by me. Why on earth have you removed fpc ?

I will labour the point a bit here because its important that you understand what just happened.

I said " your FPC is probably fine so leave it alone. ".   I wonder if you have not got the idea that fpc and lazarus are two separate things ? You probably had a good fpc install but now you have done the one thing I warned you against, removing components manually that were installed by apt.

Now you have a broken fpc install as well as a broken lazarus !

So, some more cleaning up will be necessary. Just how easy that is will depend on the version of apt that your system has. Some versions seem happy to clean up and others not and I have not worked out what the difference is !

So, as a starting point, lets see if your version of apt will still play with us, run this to see if apt still thinks it has fpc or lazarus somewhere, run them one at a time so we can see which does what  -

Code: Bash  [Select][+][-]
  1. dpkg -l | grep fpc <enter>
  2. dpkg -l | grep lazarus <enter>

If either respond (and I expect at least fpc will), you should try and remove them, you may need the force option. Again, do it in this order !

Code: Bash  [Select][+][-]
  1. sudo apt purge lazarus <enter>
  2. sudo apt purge fpcsrc <enter>
  3. sudo apt purge fpc <enter>

The lazarus one, at least should tell us that lazarus is not installed, no problems, keep going. If you see a message about not being able to remove something, or the need to "fix" a package, better stop and post the message here.

If these ran OK, then you you should do a normal -

Code: Bash  [Select][+][-]
  1. sudo apt update <enter>
  2. sudo apt upgrade <enter>


to make sure your apt database is not damaged. If its not, you should consider yourself very lucky !

Now, if things still look OK, type the following -

Code: Bash  [Select][+][-]
  1. ls -l /usr/lib/x86_64-linux-gnu/fpc  <enter>

Assuming you are using a 64bit machine.  And ..

Code: Bash  [Select][+][-]
  1. ls -l /usr/lib/lazarus <enter>
  2. ls -l /usr/lib/lazarus <enter>

You should get no response from all three of the above commands. If you do see something, then you will again have to manually remove that content BUT ONLY if you cannot remove it with apt - that is a golden rule, never ever remove something manually that you can remove with apt !

If you get through all of that and can get no response to the three "ls" commands above, then and only then, proceed to reinstall the deb files you have.  I strongly recommend you install them one at a time so you can clearly see any errors. So, move to the dir you downloaded the debs from and make sure they are there  -

Code: Bash  [Select][+][-]
  1. cd <some_dir>
  2. ls -l *.deb
  3. // all good ?
  4. sudo apt install ./fpc-laz_3.2.2_amd64.deb <enter>
  5. // look for any error messages !
  6. sudo apt install ./fpc-src_3.2.2_amd64.deb
  7. // look for any error messages !
  8. sudo apt install ./lazarus-project_2.2.0-0_amd64.deb
  9. // look for any error messages !

note the "./" in front of the debs, most important otherwise apt will try and find them in its own databases. the "./" says "these deb files right here in this dir".

Davo

PS. All these problems do relate, IMHO, to installing Lazarus from a deb. Life is so much easier if you install Lazarus from source code. You do not install it, just keep it in your home dir where you can remove it, replace it or add to it whenever you like. I sometimes wonder if the Lazarus developers should refuse to make a deb package !





Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

PierceNg

  • Sr. Member
  • ****
  • Posts: 431
    • SamadhiWeb
Re: How to Installation Lazarus 2.2.0 on linux mint?
« Reply #14 on: March 25, 2022, 04:41:11 am »
PS. All these problems do relate, IMHO, to installing Lazarus from a deb. Life is so much easier if you install Lazarus from source code. You do not install it, just keep it in your home dir where you can remove it, replace it or add to it whenever you like. I sometimes wonder if the Lazarus developers should refuse to make a deb package !

+1

When I started using Lazarus, I clicked on 'clean up and rebuild all' in a project out of curiosity and got lots of error messages about unwriteable files, because those files, as installed via the deb package, which Lazarus expects to be able to overwrite as and when, are in 'system' locations owned by root. 

The deb package of Lazarus may be Linux-friendly (according to the people who make up such rules) but I found it to be programmer-unfriendly, especially when the programmer is new to Lazarus.

 

TinyPortal © 2005-2018