Why my debian is claiming a broken dep?

Context: carefully step-by-step upgrading a Debian 11 to Debian 12

I cannot end my apt-get upgrade becase of this

The following packages have been kept back:

Additional infos:

# dpkg -C

Is returning no broken deps

root@debian:/etc/apt/sources.list.d# apt-mark showhold

I have only this packages marked as hold. And I cannot avoid this, I need php5-gd.

When trying

apt-get install init-system-helpers

I got

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:
 php5-gd : Depends: libpng12-0 (>= 1.2.13-4) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

But I already have libpng12-0 1.2.50-2+deb8u3

root@debian:/etc/apt/sources.list.d# apt-get install  libpng12-0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libpng12-0 is already the newest version (1.2.50-2+deb8u3).
libpng12-0 set to manually installed.

Actually, php5-gd is marked as hold, to avoid break a lot of legacy websites on this system.

What should I do?

  • I can still rollback to pre-upgrade snapshot
  • But I’d like to go on upgrading to debian 12
Asked By: realtebo


In Debian 12, init-system-helpers depends on usrmerge or usr-is-merged (to enforce the /usr merge). usrmerge conflicts with versions of libpng12-0 older than 1.2.54-6, and because that package is no longer available from the repositories, apt ends up in an impossible solution — it needs to keep php5-gd, which requires libpng12-0, but it also needs to upgrade init-system-helpers, which conflicts with the version of libpng12-0 you have.

To fix this, install libpng12-0 1.2.54-6 from snapshots.

This will just be a reprieve however; the PHP 5 packages are long-gone, and you should plan on migrating away from them sooner rather than later.

Answered By: Stephen Kitt
Categories: Answers Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.