Hi Michael,

> I wonder how upgrade worked in my testing..

I strongly suspect your testing involved upgrading from **Stable (Bookworm)** or **Testing (Trixie)**, where the installed `qemu-user-static` version is older (e.g., 1:8.x or 1:9.0).
Since those older versions are `< 1:9.1.0`, the existing `Replaces` field worked perfectly for your tests.

**However, for users tracking pure Unstable (Sid), there is a gap.**
I currently have `qemu-user-static` version **1:10.0.3+ds-3** installed.

Here is the proof from my system:
$ dpkg -l | grep qemu-user
ii qemu-user 1:10.0.3+ds-3 amd64 QEMU user mode emulation (static binaries)
ii qemu-user-binfmt 1:10.0.3+ds-3 amd64 QEMU user mode binfmt registration for qemu-user
ii qemu-user-static 1:10.0.3+ds-3 amd64 QEMU user mode emulation (compat/transitional package)

> The "Replaces" field is meaningless in the context when apt chooses which version of which package to install. [...] This field is not about replacing a package, but about replacing *files* within a package.

**This is exactly the problem.**
The new `qemu-user` (and `binfmt` via dependency) attempts to take over ownership of specific files (like `/usr/bin/qemu-x86_64-static`) that are currently owned by my installed `qemu-user-static` (1:10.0.3).

1. `dpkg` checks if `qemu-user` has permission to overwrite files owned by `qemu-user-static` (1:10.0.3).
2. It checks `Replaces: qemu-user-static (<< 1:9.1.0)`.
3. Since **1:10.0.3 > 1:9.1.0**, the condition fails. `dpkg` would refuse the file overwrite.
4. The APT solver anticipates this file conflict and the lack of a forceful `Breaks` (which would force removal of the old package), leading to the dependency error.

Best regards,
Zhang Pan

 




主   题:Re: Bug#1125932: Root Cause found in debian/control: Replaces version (1:9.1.0) is too old
日   期:2026年01月19日16:36
发件人:Michael Tokarev
收件人:张攀,1125932

Hi! You're replying to me only, not to the bug report. I'm adding back the bug report address. On 1/19/26 11:07, 张攀 wrote: .. > I have examined the source code of `qemu-10.2.0+ds` from unstable, and I > found the exact line causing the issue. > > In `debian/control`, under `Package: qemu-user-binfmt` (around line 604): > > Provides: qemu-user-static > Breaks: qemu-user-static > Replaces: qemu-user-static (<< 1:9.1.0) > > **The Problem:** > My installed `qemu-user-static` version is **1:10.0.3+ds-3** (from > Trixie/Sid transition). > The constraint `<< 1:9.1.0` is too low and fails to match my installed > version. > This prevents `qemu-user-binfmt` from taking over the files owned by the > old `qemu-user-static` package, causing the dependency loop/conflict. Um. This should not be a problem. The "Replaces" field is meaningless in the context when apt chooses which version of which package to install. The Replaces enters the game only when the files are being extracted to the target system, so way after the place when you experienced the failure (or so I think, anyway). This field is not about replacing a package, but about replacing *files* within a package. Breaks, Provides, Depends and Conflicts - these are the fields which are used by the apt solver when it chooses which packages to install/remove/upgrade. > **The Fix:** > Please bump the version in `Replaces` (and preferably explicitly in > `Breaks`) to cover the current 10.x versions: > > Breaks: qemu-user-static (<< 1:10.2.0+ds-2) The Breaks might work indeed, to help the apt solver to do the right thing. But it shouldn't be a problem here, in my understanding. The thing is that we're removing qemu-user-static package entirely, any version of it. > Replaces: qemu-user-static (<< 1:10.2.0+ds-2) And Replaces does nothing in this context, as I already noted before. > (Note: `Package: qemu-user` at line 578 might need a similar update if > it also takes over files, currently it also has `<< 1:9.1.0`). It's the same thing: qemu-user replaced some files of qemu-user-static package version before 9.1.0. In the later versions there were no file conflicts, so bumping this Replaces should not be needed. But what's just occured to me: maybe we need a version in Provides: qemu-user-static for qemu-user-binfmt? Maybe that's the reason why apt refuses to remove real q-u-static package in favor of unversioned Provides? I wonder how upgrade worked in my testing.. /mjt

 

 

 


---

 

Reply via email to