** Description changed:

+ [ Impact ]
+ 
+ PackageKit's APT backend still uses APT's legacy ("old") dependency solver,
+ whereas the APT command-line tools have switched to the new solver 3.0 by
+ default. This inconsistency causes PackageKit (and therefore tools built on
+ top of it, such as GNOME Software / App Center and `pkgcli`) to compute
+ different, worse solutions than `apt` for the same operation.
+ 
+ The most visible symptom is that PackageKit silently drops Recommends when
+ resolving installs that involve a virtual package provided by more than one
+ package. For example:
+ 
+     pkgcli install virt-manager
+ 
+ does NOT pull in the recommended `libvirt-daemon-system`, leaving the user
+ with a non-functional local virtualization stack, while:
+ 
+     sudo apt install virt-manager
+ 
+ correctly installs `libvirt-daemon-system` and its dependencies.
+ 
+ Root cause: the chain
+     virt-manager   Recommends libvirt-daemon-system
+     libvirt-daemon-system  Depends  libvirt-daemon-driver-qemu
+     libvirt-daemon-driver-qemu  Depends  qemu-kvm | qemu-system
+ hits a virtual package (`qemu-kvm`) that is provided by both
+ `qemu-system-x86` (GA stack) and `qemu-system-x86-hwe` (HWE stack). The old
+ solver first tries the HWE provider, generates a conflict by mixing stacks,
+ and then resolves the conflict by simply dropping the Recommends instead of
+ choosing the correct GA provider. The new solver 3.0 handles this case
+ correctly, matching the behaviour of the `apt` CLI.
+ 
+ [ Test Plan ]
+ 
+ On an up-to-date Ubuntu system with the affected packagekit version:
+ 
+  1. Ensure neither virt-manager nor libvirt-daemon-system is installed:
+         dpkg -l virt-manager libvirt-daemon-system
+  2. Run a simulated install via PackageKit:
+         pkgcli install virt-manager
+     (or via GNOME Software / App Center).
+  3. Observe the list of packages to be installed.
+ 
+ Expected result WITHOUT the fix:
+     `libvirt-daemon-system` is NOT in the install set; only the strictly
+     required dependencies are pulled in. The result differs from
+     `apt install virt-manager`.
+ 
+ Expected result WITH the fix:
+     `libvirt-daemon-system` (and the rest of the GA QEMU/virt stack, e.g.
+     `libvirt-daemon-driver-qemu`, `qemu-system-x86`, `qemu-system-common`,
+     `qemu-system-gui`, ...) IS included, matching the output of
+     `apt install virt-manager`.
+ 
+ [ Where problems could occur ]
+ 
+ The change switches the APT backend to solver 3.0 by setting
+ `APT::Solver` to "3.0" during backend initialization (guarded by an
+ `APT_PKG_ABI >= 700` check, so it only takes effect where solver 3.0 is
+ available). Because this changes the dependency-resolution engine used by
+ PackageKit, any regression would manifest as PackageKit computing different
+ install/remove/update solutions than before:
+ 
+  - Transactions that previously succeeded could in theory fail to find a
+    solution, or vice-versa, though solver 3.0 is generally strictly better
+    at producing correct results and is already the default for the `apt`
+    CLI, so PackageKit is simply being aligned with well-tested behaviour.
+ 
+ 
+ [ Other Info ]
+ 
+  * Fix forwarded upstream:
+ https://github.com/PackageKit/PackageKit/pull/983
+ 
+  * I run an extensive testing of the proposed packagekit on a set of 140 
packages related to the virt stack (reverse dependencies, virt packages). And 
the list of installed packages are identical between packagekit and APT. 
+    This give us the confidence that the transition to Solver 3.0 does not
+    break anything.
+ 
+ ---------
  Fully updated Ubuntu 26.04 LTS system, packagekit 1.3.4-3.
  
  Originally reported as an App Center issue
  (https://github.com/ubuntu/app-center/issues/2092), but "pkgcli install"
  has the same problem.
  
  When installing a deb package (from Universe, but it probably does not
  matter), only its "required" dependencies are installed, not
  "recommended" ones.
  
  You can test this yourself by running:
  
  $ pkgcli install virt-manager
  # does not install "libvirt-daemon-system", resulting in a non-working local 
virtualization
  
  vs
  
  $ sudo apt install virt-manager
  # also installs "libvirt-daemon-system" and everything works fine

** Changed in: libvirt (Ubuntu Resolute)
     Assignee: (unassigned) => Hector CAO (hectorcao)

** No longer affects: libvirt (Ubuntu Resolute)

** No longer affects: libvirt (Ubuntu Stonking)

** Changed in: packagekit (Ubuntu Resolute)
     Assignee: (unassigned) => Hector CAO (hectorcao)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2148469

Title:
  `libvirt-daemon-driver-qemu` prefers `qemu-system-x86-hwe` to satisfy
  `qemu-kvm | qemu-system` dependency

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/2148469/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to