Recent

Author Topic: Lazarus 2.0.12 on Ubuntu 21.10 install error Dependency not satisfiable  (Read 13260 times)

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
So, you are installing from debs downloaded from SourceForge ?  Which one of those three has a dependency on a maximum package ?  I would be quite surprised but I guess its possible. I would guess a 'force' would work ....

Again, are you really trying to install on U21.10 ?  You most certainly will have dependency problems doing so, it will be a long way from ready right now.

If I was you, I would read that Installing Lazarus on Linux page I mentioned earlier, especially the part that talks about installing from source. Installing Lazarus (and you have not told us which package has this strange dependency) from source lets (indeed, requires) you to resolve dependencies yourself.

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

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1111
  • Professional amateur ;-P
Hey corradoventu,

I've found how download fpc-src https://sourceforge.net/projects/freepascal/ but not fpc-laz, may you help? thanks.

You'll find all 3 deb packages that are mentioned above in the following link: https://sourceforge.net/projects/lazarus/files/Lazarus Linux amd64 DEB/Lazarus 2.0.12/

The problem is that you were looking for Lazarus in the wrong place.
The Lazarus project on SourceForge has all the necessary packages to install both the compiler and the IDE.

But maybe you should have a look into fpcupdeluxe, since it's way more practical and customizable.

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
This is getting quite confusing.

User corradoventu started this thread, he/she is using U21.10 and is trying to download Lazarus from the FreePascal download site. The solution to that problem is to get all three necessary files from under  https://sourceforge.net/projects/lazarus/files/Lazarus Linux amd64 DEB/Lazarus 2.0.12/ as described on the wiki page.  Install them with gdebi or apt, not dpkg.

User mcculloch is a completely different situation. He/she is using Mint 20 and is apparently having problems with libgtk2.0-dev.  libgtk2.0-dev  is a pretty standard package available for just about any GUI based linux  and is not supplied in any way by the FPC/Lazarus project.  I suspect some confusion may be caused if dpkg is being used, the messages it offers can sometimes be a problem.  Thats why I suggest using apt (not apt-get nor dpkg) to install Lazarus. 

If it still refuses to install using apt then is an issue that needs to be reported to Mint. Not working will break a lot of development enviournments other than Lazarus !

Just to be sure, I have just downloaded both FPC and Lazarus from the Lazarus SourceForge repos, dependencies are -

FPC - binutils  (no version mentioned)
Lazarus -  libgtk2.0-dev (>=2.6.0), fpc-laz (=3.2.0), fpc-src (=3.2.0)

So, libgtk2.0-dev has to be greater or equal to 2.6.0, there is nothing there that says it cannot be any subsequent version.

So, mcculloch, please try using apt as described in the wiki and if you still get an error message, please copy the full text of the error here.

(Note : Lazarus (in this deb) requires exactly FPC 3.2.0, so don't use wth FPC 3.2.2, the three debs are a matched set, use them as such. Thats just one more reason I suggest anyone and everyone install Lazarus from Source. Sigh ....)

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

mcculloch

  • New Member
  • *
  • Posts: 18
So, you are installing from debs downloaded from SourceForge ?  Which one of those three has a dependency on a maximum package ?  I would be quite surprised but I guess its possible. I would guess a 'force' would work ....

Again, are you really trying to install on U21.10 ?  You most certainly will have dependency problems doing so, it will be a long way from ready right now.

If I was you, I would read that Installing Lazarus on Linux page I mentioned earlier, especially the part that talks about installing from source. Installing Lazarus (and you have not told us which package has this strange dependency) from source lets (indeed, requires) you to resolve dependencies yourself.

Davo

Yes, I got the debs from sourceforge and I mentioned that I'm using Linux Mint 20. 

The last package for lazarus is the one that chokes on libgtk2.0-dev.  I get:

john@desktop02:~$ sudo apt install libgtk2.0-dev
[sudo] password for john:         
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libgtk2.0-dev : Depends: libglib2.0-dev (>= 2.27.3) but it is not going to be installed
                 Depends: libgdk-pixbuf2.0-dev (>= 2.21.0) but it is not going to be installed
                 Depends: libpango1.0-dev (>= 1.20) but it is not going to be installed
                 Depends: libatk1.0-dev (>= 1.29.2) but it is not going to be installed
                 Depends: libcairo2-dev (>= 1.6.4-6.1) but it is not going to be installed
                 Recommends: debhelper but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Sorry I don't know how to format the above better.  Either way, I tried installing glib2.0-dev and got something similar with different deps.  I've done the check for broken packges and there aren't any.  I tried installing build-essential and that also told me something similar.  apt-get install -y after any of these does nothing.  build-essential needs libc6-dev and g++.  Then I tried:

john@desktop02:~$ sudo apt-get install libc6-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libc6-dev : Depends: libc6 (= 2.31-0ubuntu9.2) but 2.31-0ubuntu9.3 is to be installed
E: Unable to correct problems, you have held broken packages.

I then tried using aptitude and anything it wants to do wants to downgrade things and I won't do that.  I also won't install from source.  Thanks for helping but this is getting way to deep into package dependencies and I'm getting nervous..  The machine I'm trying to install on is the system I do my personal business on and the risk of proceeding any further is too high for me. 

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Hmm, unlikely as it seems, that sure looks like a Mint problem.

You should be able to install libgtk2.0-dev !  Thats not a FPC/Lazarus problem.  I don't have a Mate 20 test machine so cannot confirm this problem.  Mate 20 is based on U20.04 as I understand it, my U20.04 seems to have quite different version numbers for its libgtk2.0 and libgtk.02-dev 2.24.33.  And they have to match. You seem to have 2.27.3 and 2.31.   

>The following packages have unmet dependencies:
> libc6-dev : Depends: libc6 (= 2.31-0ubuntu9.2) but 2.31-0ubuntu9.3 is to be installed

The 0ubuntu9.2 v 0ubuntu9.3 is a packaging number and can probably be safely forced but the real version numbers are a real issue. 

Have you installed some later libraries via a PPA for example ?

Do you have synaptic installed ?  Its a great GUI tool to look at installed and uninstalled packages in great detail. Could be useful here ....

Davo

EDIT: Installing from source won't help you here anyway, Your problem is apparent before you touch the FPC/Lazarus things.  Any development enviournment that uses GTK2 is going to need libgtk2.0-dev.
« Last Edit: June 04, 2021, 02:13:33 pm by dbannon »
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

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Sorry, I cannot find how or where Mint keeps its repository files.

So, if you don't have synaptic installed, please try this command -

Code: Bash  [Select][+][-]
  1. apt list | grep libgtk2.0 <enter>

Then, just in case, type this -

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

The update will just refresh apt's view of what packages are available, it will not make any changes to your system.  Then repeat the

Code: Bash  [Select][+][-]
  1. apt list | grep libgtk2.0 <enter>

If its different to earlier result, thats probably your issue, try to install libgtk2.0-dev again.  Either way, please post the result of the last commad. What we are looking for is the version numbers for libgtk2.0-dev and libgtk2.0, they MUST be the same or you have some serious problems !

Davo

EDIT: Signing off, bedtime, sure someone else will help from here.

« Last Edit: June 04, 2021, 02:31:59 pm by dbannon »
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

VTwin

  • Hero Member
  • *****
  • Posts: 1215
  • Former Turbo Pascal 3 user
You might try:

Code: Pascal  [Select][+][-]
  1. sudo apt-get -f install

to fix dependencies. See:

https://forum.lazarus.freepascal.org/index.php?topic=45314.0

FPC and Lazarus are fine.
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

mcculloch

  • New Member
  • *
  • Posts: 18
Results to both suggestions:

Code: Pascal  [Select][+][-]
  1. john@desktop02:~$ apt list | grep libgtk2.0
  2.  
  3. WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
  4.  
  5. libgtk2.0-0/focal,now 2.24.32-4ubuntu4 amd64 [installed]
  6. libgtk2.0-0/focal 2.24.32-4ubuntu4 i386
  7. libgtk2.0-bin/focal,now 2.24.32-4ubuntu4 amd64 [installed]
  8. libgtk2.0-bin/focal 2.24.32-4ubuntu4 i386
  9. libgtk2.0-cil-dev/focal 2.12.40-3 amd64
  10. libgtk2.0-cil/focal 2.12.40-3 amd64
  11. libgtk2.0-common/focal,focal,now 2.24.32-4ubuntu4 all [installed]
  12. libgtk2.0-dev/focal 2.24.32-4ubuntu4 amd64
  13. libgtk2.0-dev/focal 2.24.32-4ubuntu4 i386
  14. libgtk2.0-doc/focal,focal 2.24.32-4ubuntu4 all
  15. john@desktop02:~$ sudo apt-get -f install
  16. Reading package lists... Done
  17. Building dependency tree      
  18. Reading state information... Done
  19. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  20.  
  21.  

I've done the last one many times.

VTwin

  • Hero Member
  • *****
  • Posts: 1215
  • Former Turbo Pascal 3 user
I'm plumb out of suggestions. I've not had an issue on Ubuntu in a decade or so of using it.

I'm not a Linux wizard. Hopefully another Mint user can help.
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
As a general rule, I believe its better to solve dependencies before installing a package. Relying on "apt-get -f install" can be a problem when a package's pre and post install scripts assume dependencies are resolved, they are not supposed to but sometimes do.

Now, apt list tells us that you have the normal, as expected Focal libgtk2.0 stuff -

> libgtk2.0-0/focal,now 2.24.32-4ubuntu4 amd64 [installed]
> libgtk2.0-dev/focal 2.24.32-4ubuntu4 amd64

So, thats good.  Now, your earlier screen scrape said that it needed libglib2.0-dev (>= 2.27.3) - on my Focal testbox, I have 2.63 (2.64 on my working box) so its not a demanding request.  Please use a variation of the previous command -

> apt list | grep libglib20 <enter>

If you have something earlier than 2.27 I will be surprised !  But perhaps yours is an updated machine rather than a fresh install and somehow an old version has been left lying around ???  You can use the list command to check out the available versions of the other packages mentioned. You did update your apt database didn't you ?  I am left wondering if you have a broken apt database - usually when that happens, apt is only too keen to tell you but ....

(Again, I mention Synaptic, really great way to view versions of installed and uninstalled packages.)

I am afraid this is sounding more and more like a job for the Mint forum rather than here.  Its a pretty simple question there, "I cannot install libgtk2.0-dev" (or maybe say libglib2.0 ?).  As this problem has nothing to do with FPC/Lazarus, I suggest mentioning them would just complicate the issue.

Which version of Mint are you using ? Cinnamon probably but maybe Mate ?  If I get some time this afternoon, I'll pull down an image and try it here.  But that will, of course, be a fresh install, I suspect you have a "history" problem.

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

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
OK, had a few spare minutes after all. I build a (fresh) Mint 20.1 Cinnamon. And -

1. It does have Synaptic pre installed, would be an easier way to lookup what we needed.
2. The required libraries in the default repo all seem consistent with what I expected.
3. I installed libgtk2.0-dev without any problems. Its a fairly large install because Cinnamon does not seem to have any GTK2 installed by default but as no many apps use it, you will need it sooner or later anyway.  I am guess ing XFCe would be the same but Mate would have a lot already there.

Some notes about the install -
> "Need to get 41.6 MB of archives."
> "After this operation, 168 MB of additional disk space will be used."

As noted above, not much GTK2 there already.

> "Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libc6 amd64 2.31-0ubuntu9.2 [2,715 kB]"

Note that is the ~0ubuntu9.2 version, you were being offered 0ubuntu9.3, I wonder why ?  Looks like Mint repackaged it.  The content should not have been changed.
After a lot of stuff, finally -

> "Setting up libgtk2.0-dev:amd64 (2.24.32-4ubuntu4) ..."

I can only assume your install is somehow broken, perhaps you have manually forced an install of a later library ?  Or something you have installed forced that later library. Generally not a good idea IMHO.

Please take this issue to Mint forum, you will get a lot better help there.

Davo

Attached is the script of install.



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

mcculloch

  • New Member
  • *
  • Posts: 18
I think I used Synaptic the first time I tried installing Gtk 2.0.  It was preinstalled.  I am working with people on the Linux Mint forum.  Will Lazarus move to Gtk 3 soon?  That's my question, not theirs.  But I do suspect that will be their next question if they can't figure out how to make libgtk2.0-dev happy.

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
> Will Lazarus move to Gtk 3 soon? 

Lazarus GTK3 is available now but its sure not ready !  It has trouble with small apps, I'd rather not try to build the IDE. Contribution would be very welcome ....

Qt5 is pretty good if you don't want GTK2, its stable, fast and look excellent. I ship my app (for Linux) in both GTK2 and Qt5.  As most distros still arrive with just about all needed GTK2, that seems the preferred option for most down loaders.   

Don't let Mint put you off with a "why GTK2" approach, there are still quite a lot of GTK2 apps in their repo (well, in Ubuntu's repo really) so to dismiss GTK2 is not an option. Hmm, my Cinnamon test VM had GDebi preinstalled, thats a GTK2 app from memory ....

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

mcculloch

  • New Member
  • *
  • Posts: 18
Oh I'm sure lots of apps on Linux Mint 20 Cinnamon use GTk2.  It's the dev package that won't install.  Synaptic shows all kinds of gtk2 and glib2 stuff, just not libgtk2.0-dev.  It's definitely a LM issue.  The really frustrating part is that it keeps telling me that there are held broken packages when there really aren't.  It doesn't help when it lies to you about what is wrong.  The missing dependencies part is right, but that's about it.  I'll keep trying with the LM Forum because now I'm not sure if my system might have a serious issue.  Thanks again.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
As others have said: @mcculloch, you're somewhat out of order piggybacking onto somebody else's question, it makes life difficult for people trying to help both you and the OP.

Having said that, these days the usual cause of problems like you're seeing is an attempt to run a 32-bit app on a 64-bit system without multiarch support having been installed. However your

>The following packages have unmet dependencies:
> libc6-dev : Depends: libc6 (= 2.31-0ubuntu9.2) but 2.31-0ubuntu9.3 is to be installed

would appear to suggest that your Mint installation has self-destructed... I'm not necessarily saying it's something you've done, but I'm not saying that it's not something you've done particularly if you've forced in other apps (as I think you've suggested).

Not being able to install libgtk2.0-dev is a bit of a killer, but you could always try compiling Lazarus from source for Qt... in any event if I were you I'd not try installing any more binary packages on that system until the situation is a bit clearer.

Another possibility would be to install a clean Mint (or OS of your choice) in a Docker container, install the OS's choice of libgtk2.0-dev version etc., take a snapshot at that point and then try installing Lazarus from binary or compiling from scratch.

I'm not an unalloyed fan of Docker, but I think it does have its uses particularly if one needs to install stuff which might possibly clash with the host OS. I've used it for various things like building Lazarus-based programs for a slightly older host (i.e. one that had a "wrong" version of libc etc.) and building Mozilla apps, but I would warn that it doesn't always play nicely with existing netfilter (firewall) rules and bridging etc.

HTH in some small way.

MarkMLl




MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018