[Bug 2125393] Re: release upgrade 24.10 -> 25.04 fails: AttributeError: 'ExplodedDeb822SourceEntry' object has no attribute 'section'

Cody Christopher 2125393 at bugs.launchpad.net
Fri Oct 3 06:36:11 UTC 2025


Probably highly highly dodgy and not recommended (to clarify, I do not recommend anyone does this), but I got around this by:
- cleaning up my /etc/apt/sources.list.d/ (since it may have gotten a bit mangled by the release-upgrader crashing and not cleaning up after itself)
- adding `self.section = parent.section` to the __init__ block of ExplodedDeb822SourceEntry in `/usr/lib/python3/dist-packages/aptsources/sourceslist.py`
- rerunning do-release-upgrade.

I don't have a great understanding of the aptsources package based on my
sole experience looking at trying to deal with this, or of some of the
changes to apt over the years that this Exploded subclass is trying to
account for, but the rest of the parent Deb822SourceEntry is accessible
from the Exploded child class except for `section` - this might(??)
reasonably be seen as a bug in aptsources instead of release-upgrader,
and I think it's only a problem due to having left upgrading so late
(e.g. you manually swapped over to old-releases.ubuntu.com) - but
honestly that's pure speculation on my part. Since it also affects a
Kinetic user though, it makes me think this isn't a problem with the
release-upgrader (unless the upgrader did have a change in logic
recently and this got backported to Kinetic?), and more that some of the
apt repos get left in this edge case which hasn't been accounted for in
aptsources??

-- 
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/2125393

Title:
  release upgrade 24.10 -> 25.04 fails: AttributeError:
  'ExplodedDeb822SourceEntry' object has no attribute 'section'

Status in ubuntu-release-upgrader package in Ubuntu:
  Confirmed

Bug description:
  Problem Description

  When attempting to upgrade a system from Ubuntu 24.10 to the current
  release of Ubuntu 25.04 using sudo do-release-upgrade, the process
  fails. The upgrader crashes with a Python AttributeError after
  fetching the new upgrade tool.

  The traceback indicates the error occurs in the _addSecuritySources
  method within DistUpgradeController.py, when the script attempts to
  access a .section attribute on an ExplodedDeb822SourceEntry object,
  which does not exist. This prevents the upgrade from starting.

  Steps to Reproduce

      On a fully updated Ubuntu 24.10 system, open a terminal.

      Run the command: sudo do-release-upgrade

      Observe the tool as it begins to run and subsequently crashes.

  Expected Results

  The release upgrader should successfully prepare the system for the
  upgrade, rewrite the package source lists, and begin the process of
  downloading and installing the new packages for Ubuntu 25.04.

  Actual Results

  The upgrade process terminates prematurely and prints the following
  Python traceback to the console:

  Traceback (most recent call last):
    File "/tmp/ubuntu-release-upgrader-essb9mo7/plucky", line 8, in <module>
      sys.exit(main())
               ^^^^^^
    File "/tmp/ubuntu-release-upgrader-essb9mo7/DistUpgrade/DistUpgradeMain.py", line 235, in main
      if app.run():
         ^^^^^^^^^
    File "/tmp/ubuntu-release-upgrader-essb9mo7/DistUpgrade/DistUpgradeController.py", line 1965, in run
      return self.fullUpgrade()
             ^^^^^^^^^^^^^^^^^^
    File "/tmp/ubuntu-release-upgrader-essb9mo7/DistUpgrade/DistUpgradeController.py", line 1793, in fullUpgrade
      if not self.updateDeb822Sources():
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/ubuntu-release-upgrader-essb9mo7/DistUpgrade/DistUpgradeController.py", line 978, in updateDeb822Sources
      if not self.rewriteDeb822Sources():
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/ubuntu-release-upgrader-essb9mo7/DistUpgrade/DistUpgradeController.py", line 966, in rewriteDeb822Sources
      self._addSecuritySources()
    File "/tmp/ubuntu-release-upgrader-essb9mo7/DistUpgrade/DistUpgradeController.py", line 761, in _addSecuritySources
      e.section['Signed-By'] = '/usr/share/keyrings/ubuntu-archive-keyring.gpg'
      ^^^^^^^^^
  AttributeError: 'ExplodedDeb822SourceEntry' object has no attribute 'section'

  Additional Information

  Attempting to run the upgrade non-interactively produces the same
  AttributeError.

  Command:
  sudo do-release-upgrade -f DistUpgradeViewNonInteractive

  Output:

  Checking for a new Ubuntu release
  Your Ubuntu release is not supported anymore.
  For upgrade information, please visit:
  http://www.ubuntu.com/releaseendoflife

  Get:1 Upgrade tool signature [833 B]
  Get:2 Upgrade tool [965 kB]
  Fetched 966 kB in 0s (0 B/s)
  /usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeFetcherCore.py:237: Warning: W:Download is performed unsandboxed as root as file 'plucky.tar.gz.gpg' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

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




More information about the foundations-bugs mailing list