## Root Cause

`UbuntuDrivers/kerneldetection.py:_get_linux_metapackage()` picks the
installed kernel with the highest version number to determine the linux-
image metapackage. Cloud kernel flavours (aws, azure, gcp, etc.) often
have higher build numbers than the generic kernel (e.g., 7.0.0-1004-aws
vs 7.0.0-15-generic on Ubuntu 26.04). This causes `ubuntu-drivers
install` to select `linux-image-aws` on desktop systems, which lacks
desktop hardware support (WiFi drivers, etc.) and breaks networking.

## Fix (patch attached)

Add a two-pass approach to `_get_linux_metapackage()`:

1. **First pass:** Scan for the highest version non-cloud kernel (skips aws, 
azure, gcp, oracle, kvm, ibm flavours).
2. **Second pass (fallback):** If no non-cloud kernel is found, scan for any 
kernel (preserving correct behavior on cloud-only systems).

A new `_is_cloud_flavour()` helper identifies cloud-specific kernels by
their flavour suffix.

## Scenarios

- Desktop with both generic and aws installed → generic wins ✓
- Cloud VM with only aws installed → aws is selected via fallback ✓  
- Desktop with only generic → unchanged ✓
- Cloud VM with multiple cloud flavours → highest version cloud kernel wins ✓

## Affected

`ubuntu-drivers-common` package, `UbuntuDrivers/kerneldetection.py`

** Patch added: "ubuntu-drivers-aws-kernel-fix.patch"
   
https://bugs.launchpad.net/ubuntu/+source/ubuntu-drivers-common/+bug/2152922/+attachment/5971438/+files/ubuntu-drivers-aws-kernel-fix.patch

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

Title:
  `ubuntu-drivers install` pulls linux-image-aws instead of linux-image-
  generic on desktop, breaks network stack

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-drivers-common/+bug/2152922/+subscriptions


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

Reply via email to