Control: tags -1 moreinfo
Control: severity -1 important
thanks

Hi,

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

My test result is the following:

(https://osamuaoki.github.io/debian is my private APT repo holding debian-
reference 2.126 only.  I am using this with my Debain stable machine)

```
osamu@goofy:~/salsa/debian-reference/test 00:02:54 ↵
 $ ls -l
total 0
osamu@goofy:~/salsa/debian-reference/test 00:03:05 ↵
 $ dpkg -l debian-reference\*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                    Version      Architecture Description
+++-=======================-============-============-
=====================================================================
ii  debian-reference        2.100        all          metapackage to install
(all) translations of Debian Reference
ii  debian-reference-common 2.100        all          Debian system
administration guide, common files
ii  debian-reference-de     2.100        all          Debian system
administration guide, German translation
ii  debian-reference-en     2.100        all          Debian system
administration guide, English original
ii  debian-reference-es     2.100        all          Debian system
administration guide, Spanish translation
ii  debian-reference-fr     2.100        all          Debian system
administration guide, French translation
ii  debian-reference-id     2.100        all          Debian system
administration guide, Indonesian translation
ii  debian-reference-it     2.100        all          Debian system
administration guide, Italian translation
ii  debian-reference-ja     2.100        all          Debian system
administration guide, Japanese translation
ii  debian-reference-pt     2.100        all          Debian system
administration guide, Portuguese translation
ii  debian-reference-pt-br  2.100        all          Debian system
administration guide, Portuguese translation
ii  debian-reference-zh-cn  2.100        all          Debian system
administration guide, Chinese (Simplified) translation
ii  debian-reference-zh-tw  2.100        all          Debian system
administration guide, Chinese (Traditional) translation
osamu@goofy:~/salsa/debian-reference/test 00:07:03 ↵
 $ dpkg -l debian-reference\*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                    Version      Architecture Description
+++-=======================-============-============-
=====================================================================
ii  debian-reference        2.100        all          metapackage to install
(all) translations of Debian Reference
ii  debian-reference-common 2.100        all          Debian system
administration guide, common files
ii  debian-reference-de     2.100        all          Debian system
administration guide, German translation
ii  debian-reference-en     2.100        all          Debian system
administration guide, English original
ii  debian-reference-es     2.100        all          Debian system
administration guide, Spanish translation
ii  debian-reference-fr     2.100        all          Debian system
administration guide, French translation
ii  debian-reference-id     2.100        all          Debian system
administration guide, Indonesian translation
ii  debian-reference-it     2.100        all          Debian system
administration guide, Italian translation
ii  debian-reference-ja     2.100        all          Debian system
administration guide, Japanese translation
ii  debian-reference-pt     2.100        all          Debian system
administration guide, Portuguese translation
ii  debian-reference-pt-br  2.100        all          Debian system
administration guide, Portuguese translation
ii  debian-reference-zh-cn  2.100        all          Debian system
administration guide, Chinese (Simplified) translation
ii  debian-reference-zh-tw  2.100        all          Debian system
administration guide, Chinese (Traditional) translation
osamu@goofy:~/salsa/debian-reference/test 00:07:12 ↵
 $ apt list debian-reference\*
Listing... Done
debian-reference-common/stable,now 2.100 all [installed,automatic]
debian-reference-de/stable,now 2.100 all [installed,automatic]
debian-reference-en/stable,now 2.100 all [installed,automatic]
debian-reference-es/stable,now 2.100 all [installed,automatic]
debian-reference-fr/stable,now 2.100 all [installed,automatic]
debian-reference-id/stable,now 2.100 all [installed,automatic]
debian-reference-it/stable,now 2.100 all [installed,automatic]
debian-reference-ja/stable,now 2.100 all [installed,automatic]
debian-reference-pt-br/stable,now 2.100 all [installed]
debian-reference-pt/stable,now 2.100 all [installed,automatic]
debian-reference-zh-cn/stable,now 2.100 all [installed,automatic]
debian-reference-zh-tw/stable,now 2.100 all [installed,automatic]
debian-reference/stable,now 2.100 all [installed]
osamu@goofy:~/salsa/debian-reference/test 00:07:31 ↵
 $ sudo apt update
Hit:1 https://deb.debian.org/debian bookworm InRelease
Hit:2 https://deb.debian.org/debian bookworm-updates InRelease
Hit:3 https://deb.debian.org/debian bookworm-backports InRelease
Hit:4 https://dl.google.com/linux/chrome/deb stable InRelease
Get:5 https://osamuaoki.github.io/debian sid InRelease [1,846 B]
Hit:6 https://security.debian.org/debian-security bookworm-security InRelease
Get:7 https://osamuaoki.github.io/debian sid/main amd64 Packages [7,468 B]
Fetched 9,314 B in 1s (8,446 B/s)     
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
13 packages can be upgraded. Run 'apt list --upgradable' to see them.
osamu@goofy:~/salsa/debian-reference/test 00:07:47 ↵
 $ apt list debian-reference\*
Listing... Done
debian-reference-common/unknown 2.126 all [upgradable from: 2.100]
debian-reference-de/unknown 2.126 all [upgradable from: 2.100]
debian-reference-en/unknown 2.126 all [upgradable from: 2.100]
debian-reference-es/unknown 2.126 all [upgradable from: 2.100]
debian-reference-fr/unknown 2.126 all [upgradable from: 2.100]
debian-reference-id/unknown 2.126 all [upgradable from: 2.100]
debian-reference-it/unknown 2.126 all [upgradable from: 2.100]
debian-reference-ja/unknown 2.126 all [upgradable from: 2.100]
debian-reference-pt-br/unknown 2.126 all [upgradable from: 2.100]
debian-reference-pt/unknown 2.126 all [upgradable from: 2.100]
debian-reference-zh-cn/unknown 2.126 all [upgradable from: 2.100]
debian-reference-zh-tw/unknown 2.126 all [upgradable from: 2.100]
debian-reference/unknown 2.126 all [upgradable from: 2.100]
osamu@goofy:~/salsa/debian-reference/test 00:08:02 ↵
 $ 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 ↵
 $ 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) ...
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 ↵
 $ 
```

I see symlink /usr/share/doc/debian-reference-common/doc is properly changed to
directory ;-)  No more issue seen here.


FYI: Your previous log had: 
> | W: Download is performed unsandboxed as root as file '//debian-reference-
> de_2.125_all.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13:
> Permission denied)

This is just warning since you run this "apt-get download ..." command as root.


On Sun, 2025-04-27 at 17:15 +0200, Helmut Grohne wrote:
> Hi Osamu,
> 
> On Sun, Apr 27, 2025 at 07:01:44PM +0900, Osamu Aoki wrote:
> > Since you seem to be very knowlegeable, I have a question:
> > 
> > Isn't the APT system smart enough to run all preinst scripts of all
> > downloaded
> > packages?
> 
> apt is only half the story. In principle, you may perform upgrades with
> dselect or dpkg directly. It just so happens that everyone uses apt. Now
> apt instructs dpkg to do its thing, but subtle changes in dependencies
> may instruct apt to order its instructions differently. Ultimately, what
> needs to happen here is making valid dpkg interactions work.
> 
> Generally, dpkg may choose to unpack debian-reference-$LANG before
> unpacking debian-reference-common even though it may only configure
> debian-reference-$LANG after having configured debian-reference-common.
> In particular, debian-reference-$LANG may be unpacked before running
> debian-reference-common.preinst. I see how that is not desirable. We
> would like to tell apt and dpkg to always unpack debian-reference-common
> before unpacking debian-reference-$LANG. The way to do that is declaring
> suitable Conflicts or better Pre-Depends.
> 
> I argue that debian-reference-$LANG should really declare:
> 
>     Depends: debian-reference-common (= ${source:Version})
>     Pre-Depends: debian-reference-common (>= 2.109~)

https://www.debian.org/doc/debian-policy/ch-relationships.html#binary-dependencies-depends-recommends-suggests-enhances-pre-depends

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.

Regards,

Osamu

Reply via email to