** Description changed:

  (For APT SRU versioning, see https://wiki.ubuntu.com/AptUpdates)
  
  [Impact]
  Obsolete packages can be removed despite still having reverse dependencies 
installed, for example:
  
  Now that 24.04.1 has been released, 22.04 users are encouraged to upgrade to 
24.04 via the `do-release-upgrade` command. This issue was seen whilst testing 
this upgrade path.
  Upgrading and later rebooting a jammy GCP instance results in 
`linux-headers-6.5.0-1025-gcp` being a broken state.
  
  ```
  $ sudo apt install
  Reading package lists... Done
  Building dependency tree... Done
  Reading state information... Done
  You might want to run 'apt --fix-broken install' to correct these.
  The following packages have unmet dependencies:
   linux-headers-6.5.0-1025-gcp : Depends: linux-gcp-6.5-headers-6.5.0-1025 but 
it is not installable
  E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or 
specify a solution).
  ```
  `linux-gcp-6.5-headers-6.5.0-1025` is a dependency of 
`linux-image-6.5.0-1025-gcp` which is also not removed during the upgrade.
  
  ```
  $ apt-cache rdepends linux-headers-6.5.0-1025-gcp
  linux-headers-6.5.0-1025-gcp
  Reverse Depends:
    linux-image-6.5.0-1025-gcp
  $ apt-cache rdepends linux-image-6.5.0-1025-gcp
  linux-image-6.5.0-1025-gcp
  Reverse Depends:
  ```
  
  Running `apt --fix-broken install` resolves the error.
  ```
  $ sudo apt --fix-broken install
  Reading package lists... Done
  Building dependency tree... Done
  Reading state information... Done
  Correcting dependencies... Done
  The following packages will be REMOVED:
    linux-headers-6.5.0-1025-gcp
  0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
  After this operation, 27.9 MB disk space will be freed.
  Do you want to continue? [Y/n] y
  (Reading database ... 83770 files and directories currently installed.)
  Removing linux-headers-6.5.0-1025-gcp (6.5.0-1025.27~22.04.1) ...
  $ sudo apt install
  Reading package lists... Done
  Building dependency tree... Done
  Reading state information... Done
  0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  ```
  
  This issue was also observed after upgrading a jammy AWS instance to
  noble.
  
  ```
  $ sudo apt install
  Reading package lists... Done
  Building dependency tree... Done
  Reading state information... Done
  You might want to run 'apt --fix-broken install' to correct these.
  The following packages have unmet dependencies:
   linux-headers-6.5.0-1024-aws : Depends: linux-aws-6.5-headers-6.5.0-1024 but 
it is not installable
  E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or 
specify a solution).
  ```
  
  [Test plan]
  
+ ## Jammy APT verification
+ 
  To prepare the VMs, follow the following scheme:
  
  $ lxc launch ubuntu:jammy jammy-to-noble --vm
  $ lxc exec jammy-to-noble apt-mark lxd-agent-launcher # otherwise it resets
  
  To validate the apt change on jammy,
  
- ubuntu@jammy-to-noble$ add-apt-repository -p proposed
- ubuntu@jammy-to-noble$ apt install libapt-pkg6.0 # to upgrade libapt-pkg6.0
- ubuntu@jammy-to-noble$ do-release-upgrade
+ Edit /etc/update-manager/release-upgrades and set Prompt to "normal"
+ (since release upgrades to noble via the lts prompt are temporarily
+ blocked due to this bug)
+ 
+ $ sudo do-release-upgrade
+ 
+ After the reboot at the end, in the rebooted system, issue:
+ 
+ $ sudo apt upgrade
+ 
+ With the bug present, you will get an error like this:
+ $ sudo apt upgrade
+ Reading package lists... Done
+ Building dependency tree... Done
+ Reading state information... Done
+ You might want to run 'apt --fix-broken install' to correct these.
+ The following packages have unmet dependencies:
+  linux-headers-5.15.0-1065-kvm : Depends: linux-kvm-headers-5.15.0-1065 but 
it is not installable
+ E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or 
specify a solution).
+ 
+ 
+ ## Noble APT verification
  
  To validate the APT change on noble, we must rely on the test suite as
  we won't have a noble->oracular upgrade bug causing it, most likely.
  
  To validate an ubuntu-release-upgrader change, instead run:
  
  ubuntu@jammy-to-noble$ do-release-upgrade -p
  ubuntu@mantic-to-noble$ do-release-upgrade -p
  
  [Where problems could occur: APT SRU]
  
  For the APT change, the function in question is used in a small number
  of places:
  
  In APT library:
  - In the `upgrade` command and library function. Removals are already undone 
there before calling it so we never reach the new code path.
  - In the phased update implementation, during dist-upgrade. I expect a 
failure is lurking there that is fixed by this, but I haven't been able to 
write a reproducer to trigger it just yet.
  
  In aptitude:
  - The function is wrapped, but the wrapper never called
  
  In QApt:
  - QApt seems to rely on it for upgrading and doesn't seem to have any error 
checking of the return value. I expect it will read the error
  
  [Where problems could occur: u-r-u SRU]
  Upgrades will now result in a consistent state, but may spend hours searching 
for obsolete software again.

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

Title:
  Upgrading from jammy to noble results in a linux-headers package being
  in a broken state

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


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

Reply via email to