[Bug 2081864] Re: Cross-grades/replacements are considered replacement packages

Nick Rosbrook 2081864 at bugs.launchpad.net
Thu Jan 30 20:46:50 UTC 2025


I verified the fix using 1:24.04.25 from noble-proposed. One missing
step in the test plan is to enable multi-arch if necessary:

root at j:~# dpkg --add-architecture i386

Then copy the apt-clone tarball from the bug, and copy it's dpkg status:

root at j:~# wget https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/2081864/+attachment/5821544/+files/VarLogDistupgradeAptclonesystemstate.tar.gz
--2025-01-30 20:00:13--  https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/2081864/+attachment/5821544/+files/VarLogDistupgradeAptclonesystemstate.tar.gz
Resolving bugs.launchpad.net (bugs.launchpad.net)... 185.125.189.222, 185.125.189.223, 2620:2d:4000:1009::f3, ...
Connecting to bugs.launchpad.net (bugs.launchpad.net)|185.125.189.222|:443... connected.
HTTP request sent, awaiting response... 303 See Other
Location: https://launchpadlibrarian.net/751168817/VarLogDistupgradeAptclonesystemstate.tar.gz [following]
--2025-01-30 20:00:14--  https://launchpadlibrarian.net/751168817/VarLogDistupgradeAptclonesystemstate.tar.gz
Resolving launchpadlibrarian.net (launchpadlibrarian.net)... 185.125.189.228, 185.125.189.229, 2620:2d:4000:1009::3b8, ...
Connecting to launchpadlibrarian.net (launchpadlibrarian.net)|185.125.189.228|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 870975 (851K) [application/x-gzip]
Saving to: ‘VarLogDistupgradeAptclonesystemstate.tar.gz’

VarLogDistupgradeAptclonesyst
100%[================================================>] 850.56K
1.80MB/s    in 0.5s

2025-01-30 20:00:15 (1.80 MB/s) -
‘VarLogDistupgradeAptclonesystemstate.tar.gz’ saved [870975/870975]

root at j:~# tar xf VarLogDistupgradeAptclonesystemstate.tar.gz 
root at j:~# cp var/lib/apt-clone/dpkg-status /var/lib/dpkg/status

Run the upgrader without --proposed to verify it fails:

root at j:~# do-release-upgrade

... SNIP ...

Checking package manager
Reading package lists... Done    
Building dependency tree... Done 
Reading state information... Done

Calculating the changes

Calculating the changes

Could not calculate the upgrade

An unresolvable problem occurred while calculating the upgrade.

If none of this applies, then please report this bug using the 
command 'ubuntu-bug ubuntu-release-upgrader-core' in a terminal. If 
you want to investigate this yourself the log files in 
'/var/log/dist-upgrade' will contain details about the upgrade. 
Specifically, look at 'main.log' and 'apt.log'. 


Restoring original system state

Aborting
Reading package lists... Done    
Building dependency tree... Done 
Reading state information... Done

Then verify that the version in -proposed is able to calculate the
upgrade:

root at j:~# do-release-upgrade --proposed

Checking package manager
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done

Calculating the changes

Calculating the changes
No candidate ver:  libisc-export95
No candidate ver:  libssl1.0.0
No candidate ver:  libisc-export95
No candidate ver:  libssl1.0.0

Do you want to start the upgrade?


36 installed packages are no longer supported by Canonical. You can
still get support from the community.

173 packages are going to be removed. 313 new packages are going to
be installed. 2220 packages are going to be upgraded.

You have to download a total of 4815 M. This download will take about
16 minutes with a 40Mbit connection and about 2 hours 8 minutes with
a 5Mbit connection.

Fetching and installing the upgrade can take several hours. Once the
download has finished, the process cannot be canceled.

 Continue [yN]  Details [d]


** Tags removed: verification-needed verification-needed-noble
** Tags added: verification-done verification-done-noble

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ubuntu-release-upgrader in
Ubuntu.
https://bugs.launchpad.net/bugs/2081864

Title:
  Cross-grades/replacements are considered replacement packages

Status in ubuntu-release-upgrader package in Ubuntu:
  Invalid
Status in ubuntu-release-upgrader source package in Noble:
  Fix Committed

Bug description:
  [Impact]
  Some packages such as libcap2-bin or ghostscript-x get replaced by cross-graded/or cross-replacement packages, such as

  libcap2-bin:amd64 => libcap2-bin:i386
  ghostscript-x:amd64 => ghostscript:i386 (should be ghostscript:amd64)

  These are Multi-Arch: foreign, hence each architecture provides each
  other, in some way.

  The 2nd case is actually fine (the result is marking ghostscript-x for
  removal, but the correct replacement exists), but the first one, the
  one in this bug, breaks upgrades (there may be more instances).

  In most cases this does not cause an issue, as the package being
  replaced must not be downloadable anymore. In this case, libcap2-bin
  was installed in a higher version than available in noble (due to
  epoch). Other cases include held packages (the jammy/mantic version
  will not be downloadable either), pinning.

  [Test plan]

  Ensure the apt-clone tarballs in this bug can be properly
  upgraded/upgrade resolution completes.

  A quick validation is to
  1. start a container
  2. replace its /var/lib/dpkg/status with /var/lib/apt-clone/dpkg-status
  3. check that do-release-upgrade fails
  4. check that do-release-upgrade -p gets to the install prompt

  A more extensive E2E validation is to fully restore the tarball in a
  VM, and then actually execute the full upgrade and not just calculate
  it, but this seems superfluous.

  [Where problems could occur]
  We are skipping removals for packages where the only detected replacement packages are for another architecture; there could be problems if there are
  packages that really only have replacements on a different architecture.

  [Other information]

  This patch applies to the t64 library transition logic in u-r-u, which
  is only present in noble. Hence, the patch is only for that release.

  [Original bug report]
  Hello ubuntu devs,

  Trying to upgrade from mantic to noble but my system has broken
  packages. About 93 now. Before they were almost 200

  I tried removing some broken packages and made some mistakes on the way I guess.
  The point is that I also have some fundamental packages in broken state. For instance, python3 and I cannot remove it since it depends on grub-common.

  The error from /var/log/dist-upgrade is:

  # grep 'E:' main.log
  2024-09-24 18:26:37,663 ERROR Dist-upgrade failed: 'E:Unable to correct problems, you have held broken packages.'

  I tried many things, I checked with dpkg --get-selections if I had hold packages and I did not have.
  My last try was to mark as "hold" grub packages:

  # apt-mark showhold
  grub-efi-amd64-bin
  grub-efi-amd64-signed

  Could you please give a hand on this one?

  Thank you very much in advance!

  ProblemType: Bug
  DistroRelease: Ubuntu 23.10
  Package: ubuntu-release-upgrader-core 1:23.10.14
  ProcVersionSignature: Ubuntu 6.5.0-44.44-generic 6.5.13
  Uname: Linux 6.5.0-44-generic x86_64
  NonfreeKernelModules: nvidia_modeset nvidia
  ApportVersion: 2.27.0-0ubuntu5
  Architecture: amd64
  CasperMD5CheckResult: unknown
  CrashDB: ubuntu
  CrashReports:
   640:0:115:325160:2024-09-23 19:38:03.393134716 +0200:2024-09-23 19:37:57.853134596 +0200:/var/crash/_usr_sbin_thermald.0.crash
   640:1000:115:933873:2024-09-22 13:47:22.006442070 +0200:2024-09-22 13:47:23.006442070 +0200:/var/crash/_usr_bin_light-locker.1000.crash
  CurrentDesktop: KDE
  Date: Tue Sep 24 18:33:04 2024
  InstallationDate: Installed on 2016-03-16 (3114 days ago)
  InstallationMedia: Ubuntu 15.10 "Wily Werewolf" - Release amd64 (20151021)
  PackageArchitecture: all
  SourcePackage: ubuntu-release-upgrader
  UpgradeStatus: Upgraded to mantic on 2024-09-24 (0 days ago)
  VarLogDistupgradeAptHistorylog:
   Start-Date: 2024-09-24  18:25:07
   Requested-By: beatpanic (1000)
   End-Date: 2024-09-24  18:25:07
  VarLogDistupgradeApttermlog:
   Log started: 2024-09-24  18:25:07
   Log ended: 2024-09-24  18:25:07

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/2081864/+subscriptions




More information about the foundations-bugs mailing list