[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1053657: dhcpcd-base has ineffective Replaces due to /usr-merge and looses files in upgrade



Package: dhcpcd-base
Version: 9.4.1-24~deb12u2
Severity: serious
Justification: file loss during upgrade
X-Debbugs-Cc: debian-release@lists.debian.org
User: helmutg@debian.org
Usertags: dep17p1

Unfortunately, the stable update of dhcpcd5 introduced a regression
relevant to upgrades from bullseye. The bullseye dhcpcd5 package
contained the files
 - /lib/dhcpcd/dhcpcd-hooks/01-test
 - /lib/dhcpcd/dhcpcd-hooks/20-resolv.conf
 - /lib/dhcpcd/dhcpcd-hooks/30-hostname
 - /lib/dhcpcd/dhcpcd-hooks/60-ntp-common.conf
 - /lib/dhcpcd/dhcpcd-hooks/62-chrony.conf
 - /lib/dhcpcd/dhcpcd-hooks/64-timesyncd.conf
 - /lib/dhcpcd/dhcpcd-hooks/68-openntpd.conf
 - /lib/dhcpcd/dhcpcd-run-hooks
and these have been moved into dhcpcd-base in that particular stable
update. The update correctly declares Replaces for this. Unfortunately,
it also moves these files from /lib to /usr/lib. Therefore, the declared
Replaces have no effect (regarding these files) and as a consequence, an
upgrade may delete the affected files. Fortunately, a very simple
upgrade from bullseye to bookworm with only dhcpcd5 installed unpacks
the new dhcpcd5 package before unpacking dhcpcd-base and therefore the
issue is not trivially reproducible and probably does not affect the
majority of users. We cannot rule out other upgrade scenarios though and
we can also construct a breaking scenario using mmdebstrap.

mmdebstrap bullseye /dev/null --variant=apt --include dhcpcd5 --chrooted-customize-hook='sed -i -e s/bullseye/bookworm/ /etc/apt/sources.list && apt update && apt-get install -y libc6 usrmerge && apt-get download dhcpcd-base && dpkg --auto-deconfigure --unpack ./dhcpcd-base_*.deb && dpkg -r dhcpcd5 && ls /usr/lib/dhcpcd/dhcpcd-hooks'

If you run this, it ends with:

| Selecting previously unselected package dhcpcd-base.
| dpkg: considering deconfiguration of dhcpcd5, which would be broken by installation of dhcpcd-base ...
| dpkg: yes, will deconfigure dhcpcd5 (broken by dhcpcd-base)
| (Reading database ... 6731 files and directories currently installed.)
| Preparing to unpack .../dhcpcd-base_9.4.1-24~deb12u2_amd64.deb ...
| De-configuring dhcpcd5 (7.1.0-2+b1) ...
| Unpacking dhcpcd-base (9.4.1-24~deb12u2) ...
| Replacing files in old package dhcpcd5 (7.1.0-2+b1) ...
| (Reading database ... 6752 files and directories currently installed.)
| Removing dhcpcd5 (7.1.0-2+b1) ...
| ls: cannot access '/usr/lib/dhcpcd/dhcpcd-hooks': No such file or directory

This kind of problem has been categorized in the
https://subdivi.de/~helmut/dep17.html as P1 and the recommended
mitigation M7 is changing Breaks+Replaces to Conflicts. I think this
mitigation is fully applicable here, because apt will by default unpack
the updated dhcpcd5 package first and then the conflict is resolved. The
additional constraint is satisfied by the default solution of apt.

I am not sure why dhcpcd-base has moved these files from / to /usr in
violation of the file move moratorium that was meant to prevent
precisely this kind of bug. In any case, please do *not* move them back
as that could cause further trouble.

I'm sorry for not having spotted this before the point release and will
now monitor stable p-u suites for similar problems to raise this
earlier. Can I assume that a package sits in p-u for at least three days
before migrating to a stable release?

Helmut


Reply to: