Upgrade to 25.10 failed, packages now in inconsistent state. How to fix?

Ubuntu Support Template

Ubuntu Version:
25.04

Desktop Environment (if applicable):
GNOME

Problem Description:
To update from 25.04 to 25.10 I did “apt update”, “apt upgrade”, rebooted, then ran “do-release-upgrade”.

This failed badly midway through:

Läs:100 https://ftp.udx.icscoe.jp/Linux/ubuntu questing/main amd64 lib32ubsan1 amd64 15.2.0-4ubuntu4 [1 172 kB]
4% [100 lib32ubsan1 32,5 kB/1 172 kB 2%] 10,0 MB/s 6min 25s
https: ./methods/connect.cc:892: virtual bool TlsFd::HasPending(): Försäkran ”ssl” ej uppfylld.
Hämtade 191 MB på 6s (10,0 MB/s)

Traceback (most recent call last):
File “/tmp/ubuntu-release-upgrader-p4hrqo31/questing”, line 8, in
sys.exit(main())

apt_pkg.Error: W:Ignorerar filen ”rocm.list.migrate” i katalogen ”/etc/apt/sources.list.d/” eftersom den har en ogiltig filändelse, W:Ignorerar filen ”steam-beta.list.migrate” i katalogen ”/etc/apt/sources.list.d/” eftersom den har en ogiltig filändelse,
(“Ignoring file “…” in catalog “/etc/apt/sources.list.d” because it has the wrong file ending”)

My problem now is, my system is in an inconsistent state. I have ~2100 “updates” (the new packages), and “do-release-upgrade” won’t run until I’ve updated. “lsb-release” still reports 25.04.

I do have recent backups (and I’m making a straight copy to a separate drive). I would like to avoid doing a clean reinstall if possible; I was planning on doing that for the next LTS, and I’d be OK with staying on 25.04 until then.

/etc/sources.d/ has a pile of files ending with “save”, “migrate”, “distUpgrade” and “Sources” endings.

Is there a way to regenerate the apt sources, and get the system back into a consistent state?

Welcome to Ubuntu Discourse :slight_smile:

I edited and removed the parts of the template you seem not to have used.

Please install inxi and then run these commands:

sudo apt install inxi
inxi -S
inxi -r

Copy the terminal output and paste it back here in your reply. Then highlight the text and click on </> in the composer to wrap with code tags.

Thanks

Thanks! Here it is:

$ inxi -S
System:
  Host: ymer Kernel: 6.14.0-35-generic arch: x86_64 bits: 64
  Desktop: GNOME v: 48.0 Distro: Ubuntu 25.04 (Plucky Puffin)

$ inxi -r
Repos:
  No active apt repos in: /etc/apt/sources.list
  No active apt repos in: /etc/apt/sources.list.d/steam-beta.list
  No active apt repos in: /etc/apt/sources.list.d/amdgpu-proprietary.sources
  No active apt repos in: /etc/apt/sources.list.d/ernstp-ubuntu-mesarc-jammy.sources
  No active apt repos in: /etc/apt/sources.list.d/kisak-ubuntu-kisak-mesa-plucky.sources
  No active apt repos in: /etc/apt/sources.list.d/steam.sources
  No active apt repos in: /etc/apt/sources.list.d/third-party.sources
  Active apt repos in: /etc/apt/sources.list.d/ubuntu.sources
    1: deb https://ftp.udx.icscoe.jp/Linux/ubuntu/ questing questing-updates questing-security questing-backports main restricted universe multiverse

Would just copy ubuntu.sources.distUpgrade to ubuntu.sources be enough to fix it well enough to stay with Plucky until a fresh reinstall next year?

Reason I ask instead of trying is, I don’t want to break things further, so better to check with others first.

There’s a Debian bug filed for apt here that matches the initial error:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1107827

A poke around the Ubuntu upgrade scripts shows (as expected) that apt dies trying to download a package. And the Python script doesn’t catch the failure so it too dies without cleaning up after itself. My next step is probably to try to follow the abort process in DistUpgradeController.py .

So, for future me:

  • move ubuntu.sources.distUpgrade to ubuntu.sources
  • run sudo dpkg configure -a
  • do sudo apt update

And things seem more or less back to normal. Concurrency is hard; who would’ve thought?

Still need to add back the steam repo, then retry the upgrade (some page says doing " GNUTLS_CPUID_OVERRIDE=0x1" may help avoid it).

A final note: there seems to be another possible issue in the Ubuntu upgrade scripts.

On any failure, DistUpgradeController.py calls “self.abort()”, which restores the sources, then calls openCache() to regenerate the package lists. But, if openCache() fails, it calls “self.abort()” to unwind and fix everything. That looks like potential trouble to me.