3

I have this issue when I search to install Gimp:

$ sudo apt-get install gimp 
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:
 gimp : Depends: libgimp2.0 (>= 2.10.18) but it is not going to be installed
        Depends: libgimp2.0 (<= 2.10.18-z) but it is not going to be installed
        Depends: libgegl-0.4-0 (>= 0.4.22) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Nothing change after apt update & upgrade. Do you have a solution for me? Thanks to

Best,

  • 1
    Please add output of apt-cache policy gimp to the question. – N0rbert May 29 at 12:45
2

I would recommend installing Gimp as a flatpak, as the flatpak is maintained by the gimp developers.

sudo apt install flatpak

flatpak install flathub org.gimp.GIMP

and to run

flatpak run org.gimp.GIMP
| improve this answer | |
2

Firstly, update and upgrade so everything is fresh:

sudo apt-get update && sudo apt-get upgrade -y

Then, try these two commands:

sudo dpkg --configure -a
sudo apt-get install -f

They will usually fix broken or unmet dependencies.

You can also look for JUST files related with your package and purge them, then reinstall them:

sudo dpkg --list
sudo apt-get purge <file-name>

Or you can use aptitude in place of apt or apt-get, aptitude is smarter than apt-get and will help deal with dependencies:

sudo aptitude install gimp

Hope it helps!

| improve this answer | |
  • I would reorder the commands. As very first to a apt-get update (or apt or aptitude this does not matter here). This will make sure that the package list is recent and consistent and any problems that may have been resolved in the meantime are gone. There is a certain chance that this was a bug in the packaging and usually such bugs are detected and fixed quickly. – allo May 29 at 21:02
1

One solution is to use aptitude. It is generally smarter than apt-get at resolving dependencies.

First, install aptitude:

sudo apt-get install aptitude

Then install Gimp using aptitude:

sudo aptitude install gimp

And then after running that, Gimp should be installed.

| improve this answer | |
  • Isn't aptitude already installed just apt? – larkey May 29 at 21:34
  • @larkey no, they're different things. – hobbs May 29 at 23:07
  • Hm, can't remember where I picked that up. – larkey May 30 at 8:16
  • Quoted from the Debian wiki. Aptitude has a "score-based dependency resolver which is more suitable for interactive dependency resolution with additional hints from the user like "I don't want that part of the solution but keep that other part of the solution for your next try". Apt's dependency resolver on the other hand is optimized for good "one shot" solutions." – Daniel Massey May 30 at 8:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.