I hit the same issue on Ubuntu 26.04 (apt 3.2.0): a plain apt full-
upgrade installed linux-image-7.0.0-1008-gke and linux-
modules-7.0.0-1008-gke next to the expected 7.0.0-42-generic. GRUB
booted the gke kernel because 1008 sorts above 42, the NVIDIA DKMS
module was missing, and both external displays went dark.

I reproduced it, and the root cause seems to be in APT's 3.0 solver
(solver3) rather than in VirtualBox's packaging, so I'm adding an apt
task. Note also that virtualbox-7.2 is Oracle's package from
download.virtualbox.org, not built from Ubuntu's virtualbox source
package.

REPRODUCER (clean 26.04 container, archive pinned via snapshot.ubuntu.com):
1. APT::Snapshot "20261027T072000Z"; install linux-generic, linux-image-generic 
and linux-headers-generic, all =7.0.0-38.38; install virtualbox-7.2 from 
download.virtualbox.org. A dummy local package with only Recommends: 
linux-image triggers it just the same.
2. APT::Snapshot "20261028T074000Z"; apt update; apt -s full-upgrade.

Expected: only linux-image-7.0.0-42-generic is installed. The recommend is 
already satisfied by the installed linux-image-7.0.0-38-generic, and will be by 
-42 too.
Actual: linux-image-7.0.0-1008-gke and linux-modules-7.0.0-1008-gke are 
installed as well.

The first three rows were tested with the real virtualbox-7.2; the rest
with apt 3.2.0 and the dummy package.

    Variant                                               gke installed?
    apt 3.2.0, default solver (3.0)                       yes
    apt 3.3.3 (from 26.10), default solver                yes
    --solver internal (3.2.0 and 3.3.3)                   no
    apt upgrade                                           no
    -o APT::Install-Recommends=0                          no
    no package with Recommends: linux-image               no
    old -38 image marked manual                           no
    linux-generic metapackages held (no kernel ABI bump)  no

SOLVER TRACE (-o Debug::APT::Solver=2, attached):

    [225] Install:linux-image-7.0.0-1008-gke:amd64=7.0.0-1008.9 
(virtualbox-7.2:amd64)
    [231] Install:linux-image-7.0.0-42-generic:amd64=7.0.0-42.42 
(linux-generic:amd64 -> ... -> linux-image-7.0.0-42-generic:amd64)
    [242] Install:linux-image-7.0.0-38-generic:amd64=7.0.0-38.38 (...)

The installed auto-installed kernel is queued as an optional "keep" and
only decided at depth 242. The recommend of the manually installed
virtualbox-7.2 is resolved earlier, at depth 225. At that point no
provider of linux-image has been decided, so solver3 picks the highest-
versioned provider (gke 1008) instead of the one that is already
installed. This only bites when a kernel ABI bump lands. Before that,
linux-image-generic still depends on the installed image, which
satisfies the recommend early. That would also explain why the flavour
moves on to azure-fde and then oracle once gke is excluded, as described
above.

WORKAROUND: APT::Solver "internal"; in /etc/apt/apt.conf.d/. Pinning out
a single flavour is not enough.

Attached: solver traces for apt 3.2.0 (solver3 and internal) and apt
3.3.3 (solver3).

** Attachment added: "apt -o Debug::APT::Solver=2 traces (3.2.0 
solver3/internal, 3.3.3 solver3)"
   
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/2169247/+attachment/6013377/+files/apt-solver3-gke-traces.tar.gz

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

Title:
  virtualbox-7.2 Recommends: linux-image causes APT to install arbitrary
  cloud kernel flavours

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


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

Reply via email to