Control: tags -1 - moreinfo Control: severity -1 serious On Tue, Apr 29, 2025 at 01:00:58AM +0900, Osamu Aoki wrote: > It took me some time to set up my private apt repository to test next upload > in > advance without using the real Debian repository ;-) That leads me to the > following conclusion. > > 1. There were a bug in version 2.125 > 2. Your testing script lead me to realize the bug. > 3. I see no issue here on 2.126 packages. (See below log) > 4. My fix use no pre-depends following policy guidance (See the bottom) > > Can you show me actual failure log you observed on your system with the > current > 2.126 packages. Until then, let me downgrade this bug
Sure. Take my previous reproducer and replace trixie with sid since 2.126 has not yet migrated. | $ mmdebstrap --variant=apt '' /dev/null 'deb http://deb.debian.org/debian bookworm main' --include=debian-reference-common --chrooted-customize-hook='sed -i -e s/bookworm/sid/ /etc/apt/sources.list && apt-get update && apt-get download debian-reference-de && dpkg --unpack --auto-deconfigure *.deb && apt-get -y -f install && dpkg --verify' | I: automatically chosen mode: unshare | I: chroot architecture amd64 is equal to the host's architecture | I: automatically chosen format: null | I: using /tmp/mmdebstrap.Njtt81dugF as tempdir | I: running apt-get update... | done | I: downloading packages with apt... | done | I: extracting archives... | done | I: installing essential packages... | done | I: installing remaining packages inside the chroot... | done | done | I: running --chrooted-customize-hook in shell: sh -c 'sed -i -e s/bookworm/sid/ /etc/apt/sources.list && apt-get update && apt-get download debian-reference-de && dpkg --unpack --auto-deconfigure *.deb && apt-get -y -f install && dpkg --verify' | Get:1 http://deb.debian.org/debian sid InRelease [205 kB] | Get:2 http://deb.debian.org/debian sid/main amd64 Packages [10.1 MB] | Fetched 10.3 MB in 1s (8266 kB/s) | Reading package lists... Done | Get:1 http://deb.debian.org/debian sid/main amd64 debian-reference-de all 2.126 [1927 kB] | Fetched 1927 kB in 0s (63.3 MB/s) | W: Download is performed unsandboxed as root as file '//debian-reference-de_2.126_all.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied) | Selecting previously unselected package debian-reference-de. | (Reading database ... 6748 files and directories currently installed.) | Preparing to unpack debian-reference-de_2.126_all.deb ... | Unpacking debian-reference-de (2.126) ... | Reading package lists... Done | Building dependency tree... Done | Reading state information... Done | Correcting dependencies... Done | The following additional packages will be installed: | debian-reference-common | Suggested packages: | calibre debian-reference debian-reference-en debian-reference-es debian-reference-fr debian-reference-id debian-reference-it debian-reference-ja debian-reference-pt | debian-reference-zh-cn debian-reference-zh-tw mc vim | Recommended packages: | w3m | www-browser | The following packages will be upgraded: | debian-reference-common | 1 upgraded, 0 newly installed, 0 to remove and 77 not upgraded. | 1 not fully installed or removed. | Need to get 38.1 kB of archives. | After this operation, 7168 B of additional disk space will be used. | Get:1 http://deb.debian.org/debian sid/main amd64 debian-reference-common all 2.126 [38.1 kB] | Fetched 38.1 kB in 0s (3663 kB/s) | (Reading database ... 6771 files and directories currently installed.) | Preparing to unpack .../debian-reference-common_2.126_all.deb ... | Unpacking debian-reference-common (2.126) over (2.100) ... | dpkg: warning: unable to delete old directory '/usr/share/debian-reference': Directory not empty | Setting up debian-reference-common (2.126) ... | Setting up debian-reference-de (2.126) ... | missing /usr/share/doc/debian-reference-common/docs/apa.de.html | missing /usr/share/doc/debian-reference-common/docs/ch01.de.html | missing /usr/share/doc/debian-reference-common/docs/ch02.de.html | missing /usr/share/doc/debian-reference-common/docs/ch03.de.html | missing /usr/share/doc/debian-reference-common/docs/ch04.de.html | missing /usr/share/doc/debian-reference-common/docs/ch05.de.html | missing /usr/share/doc/debian-reference-common/docs/ch06.de.html | missing /usr/share/doc/debian-reference-common/docs/ch07.de.html | missing /usr/share/doc/debian-reference-common/docs/ch08.de.html | missing /usr/share/doc/debian-reference-common/docs/ch09.de.html | missing /usr/share/doc/debian-reference-common/docs/ch10.de.html | missing /usr/share/doc/debian-reference-common/docs/ch11.de.html | missing /usr/share/doc/debian-reference-common/docs/ch12.de.html | missing /usr/share/doc/debian-reference-common/docs/debian-reference.de.pdf | missing /usr/share/doc/debian-reference-common/docs/debian-reference.de.txt.gz | missing /usr/share/doc/debian-reference-common/docs/index.de.html | missing /usr/share/doc/debian-reference-common/docs/pr01.de.html | I: cleaning package lists and apt cache... | done | done | I: removing tempdir /tmp/mmdebstrap.Njtt81dugF... | I: success in 11.5543 seconds | $ > $ apt-get download debian-reference-de > Get:1 https://osamuaoki.github.io/debian sid/main amd64 debian-reference-de > all > 2.126 [1,925 kB] > Fetched 1,925 kB in 1s (2,714 kB/s) > osamu@goofy:~/salsa/debian-reference/test 00:11:17 ↵ > $ ls -l > total 1892 > -rw-r--r-- 1 osamu osamu 1925248 Apr 28 23:23 > debian-reference-de_2.126_all.deb > osamu@goofy:~/salsa/debian-reference/test 00:11:28 ↵ > $ sudo dpkg --unpack --auto-deconfigure debian-reference-de_2.126_all.deb > (Reading database ... 636494 files and directories currently installed.) > Preparing to unpack debian-reference-de_2.126_all.deb ... > Unpacking debian-reference-de (2.126) over (2.100) ... > Processing triggers for doc-base (0.11.1) ... > Processing 1 changed doc-base file... > osamu@goofy:~/salsa/debian-reference/test 00:13:12 ↵ This is closely following my reproducer. At this point, the damage should be there. Whilst, debian-reference-de.preinst attempts to perform the link to directory conversion, the link is owned by the "wrong" package and hence the helper does not act. At this point, dpkg --verify should tell you about missing files. > $ sudo apt-get -y -f install > Reading package lists... Done > Building dependency tree... Done > Reading state information... Done > Correcting dependencies... Done > The following additional packages will be installed: > debian-reference-common > Suggested packages: > calibre > The following packages will be upgraded: > debian-reference-common > 1 upgraded, 0 newly installed, 0 to remove and 11 not upgraded. > 1 not fully installed or removed. > Need to get 0 B/38.1 kB of archives. > After this operation, 7,168 B of additional disk space will be used. > N: Make snapshot (system snapshot mode): BASE=/ > DEST=/disk_volume/main/@rootfs-snapshots TIME=2025-04-28T15:13:54+00:00 > TYPE=pre > Create a snapshot of '/' in '/disk_volume/main/@rootfs-snapshots/2025-04- > 28T15:13:54+00:00.pre' > apt-listchanges: Reading changelogs... > (Reading database ... 636493 files and directories currently installed.) > Preparing to unpack .../debian-reference-common_2.126_all.deb ... > Unpacking debian-reference-common (2.126) over (2.100) ... > Setting up debian-reference-common (2.126) ... This is when the link really got converted into a directory. > Setting up debian-reference-de (2.126) ... > Processing triggers for mailcap (3.70+nmu1) ... > Processing triggers for desktop-file-utils (0.26-1) ... > Processing triggers for gnome-menus (3.36.0-1.1) ... > Processing triggers for man-db (2.11.2-2) ... > N: Make snapshot (system snapshot mode): BASE=/ > DEST=/disk_volume/main/@rootfs-snapshots TIME=2025-04-28T15:13:57+00:00 > TYPE=post > Create a snapshot of '/' in '/disk_volume/main/@rootfs-snapshots/2025-04- > 28T15:13:57+00:00.post' > Scanning processes... > > Scanning processor microcode... > > Scanning linux images... > > > Running kernel seems to be up-to-date. > > The processor microcode seems to be up-to-date. > > No services need to be restarted. > > No containers need to be restarted. > > No user sessions are running outdated binaries. > > No VM guests are running outdated hypervisor (qemu) binaries on this host. > osamu@goofy:~/salsa/debian-reference/test 00:13:59 ↵ > $ > ``` Yeah. It looks as if all is right, but some files are now elsewhere and dpkg --verify tells you which. > I see symlink /usr/share/doc/debian-reference-common/doc is properly changed > to > directory ;-) No more issue seen here. Yes, the migration from link to directory works, but debian-reference-de was unpacked before said migration. Therefore files installed beneath the link have been redirected elsewhere. > In this section, Policy states: > > > Pre-Depends are also required if the preinst script depends on the named > > package. It is best to avoid this situation if possible. > > > > Pre-Depends should be used sparingly, preferably only by packages whose > > premature upgrade or installation would hamper the ability of the system to > > continue with any upgrade that might be in progress. > > > > You should not specify a Pre-Depends entry for a package before this has > > been > > discussed on the debian-devel mailing list and a consensus about doing that > > has been reached. See Dependencies. > > > > In my test, the updated package seems to work without pre-depends, I should > avoid using it, I think. I am aware of this policy aspect. I argue that this is one of those exceptional cases where Pre-Depends really is the cure and the risk of downsides is manageable, because the packages that shall issue Pre-Depends do not have any reverse dependencies. There is another relatively simple argument that might help with understanding the matter. Take a moment to think about file ownership in a packaging sense. Initially, /usr/share/doc/debian-reference-common/docs is a symbolic link owned by debian-reference-common. Now you unpack debian-reference-de, which installs the same location as a directory. Which package is now the proper owner of that file? After unpacking debian-reference-de, there is no obligation to configure it. You may as well remove it again. Now that location will be gone, but debian-reference-common (which hasn't been upgraded yet) would still own it in principle. In a normal situation, you'd declare Breaks+Replaces from debian-reference-de for debian-reference-common, because you are transferring ownership of a file. However, that method does not work for links being turned into directories and therefore we need the stronger cousin Conflicts. Unfortunately, Conflicts are not sufficient either, because dpkg actually allows concurrent unpacks despite declared Conflicts if the other package is going away. Therefore, there is no reliable mechanism weaker than Pre-Depends that reliably avoids the file-loss situation. And yeah, by all means, discuss the use of Pre-Depends with d-devel@l.d.o. Helmut