Public bug reported:

Summary generated by Gemini 3.8 Flash

Package: apt, libapt-pkg7.0                                                     
                                              
    Severity: critical                                                          
                                                  
    Tags: upgrade-failure, packaging                                            
                                                  
                                                                                
                                                  
    [Summary]                                                                   
                                                  
    During a release upgrade to Ubuntu 26.04 (resolute), if dpkg encounters any 
error (such as an unowned file in xkb-data or disk
  space issue) after unpacking libapt-pkg7.0 but before unpacking the apt 
binary, the package manager becomes completely non-     
  functional with a symbol lookup error. This leaves the system in a broken, 
half-upgraded state that cannot self-heal or be      
  repaired via 'apt' / 'apt-get'.                                               
                                                  
                                                                                
                                                  
    [Root Cause]                                                                
                                                  
    Between apt 3.1.6ubuntu2 and apt/libapt-pkg7.0 3.2.0, the C++ ABI changed:  
                                                  
    - In 3.1.6:                                                                 
                                                  
      APT::Solver::InternalCliWhy(pkgDepCache&, pkgCache::PkgIterator, bool)    
                                                  
      Mangled: 
_ZN3APT6Solver14InternalCliWhyB5cxx11ER11pkgDepCacheN8pkgCache11PkgIteratorEb   
                                   
    - In 3.2.0:                                                                 
                                                  
      The function was moved into the DependencySolver class:                   
                                                  
      APT::Solver::DependencySolver::InternalCliWhy(pkgDepCache&, 
pkgCache::PkgIterator, bool)                                    
      Mangled: 
_ZN3APT6Solver16DependencySolver14InternalCliWhyB5cxx11ER11pkgDepCacheN8pkgCache11PkgIteratorEb
                    
                                                                                
                                                  
    Flaws in packaging:                                                         
                                                  
    1. Both 3.1.6 and 3.2.0 use the same symbol version tag: APTPKG_7.0.        
                                                  
    2. Both share the same package name: libapt-pkg7.0.                         
                                                  
    3. Crucially, the package libapt-pkg7.0 (3.2.0) DOES NOT declare:           
                                                  
       Breaks: apt (<< 3.2.0)                                                   
                                                  
                                                                                
                                                  
    Because libapt-pkg7.0 (>= 3.1.6) is satisfied by 3.2.0, dpkg is permitted 
to unpack libapt-pkg7.0 ahead of the apt binary. If 
  an error occurs in any intermediate package, the system is left with:         
                                                  
    - /usr/lib/x86_64-linux-gnu/libapt-pkg.so.7.0 (version 3.2.0)               
                                                  
    - /usr/bin/apt (version 3.1.6)                                              
                                                  
                                                                                
                                                  
    Any invocation of 'apt' or 'apt-get' immediately crashes with:              
                                                  
    "apt: symbol lookup error: apt: undefined symbol:                           
                                                  
  
_ZN3APT6Solver14InternalCliWhyB5cxx11ER11pkgDepCacheN8pkgCache11PkgIteratorEb, 
version APTPKG_7.0"                              
                                                                                
                                                  
    When do-release-upgrade catches the dpkg error, it invokes apt/python3-apt 
to analyze or explain why packages failed, which   
  triggers this crash and completely aborts the recovery mechanism.             
                                                  
                                                                                
                                                  
    [Real-World Trigger Example]
    In this instance, the upgrade was interrupted by xkb-data (2.46-2):
    - The user had a custom layout file created in 
/usr/share/X11/xkb/symbols/grouplock/mycapslock.
    - During unpack, dpkg-maintscript-helper dir_to_symlink failed:
      "dpkg-maintscript-helper: error: directory '/usr/share/X11/xkb' contains 
files not owned by package xkb-data:all, cannot    
  switch to symlink"
    - dpkg exited with code 1 at package #27 (xkb-data).
    - libapt-pkg7.0 was already unpacked at 3.2.0, but apt was still 3.1.6.
    - The system became unrecoverable without manual low-level dpkg 
intervention.
  
    [Steps to Reproduce]
    1. Install an earlier Ubuntu release (e.g. 24.04 / 25.10).
    2. Place any unowned file in a directory slated for dir_to_symlink:
       sudo touch /usr/share/X11/xkb/symbols/custom_test_file
    3. Run do-release-upgrade to 26.04.
    4. dpkg will abort upon processing xkb-data.
    5. Attempt to run 'apt' or 'apt --fix-broken install'.
    6. Observe:
       apt: symbol lookup error: apt: undefined symbol:
  
_ZN3APT6Solver14InternalCliWhyB5cxx11ER11pkgDepCacheN8pkgCache11PkgIteratorEb, 
version APTPKG_7.0
  
    [Proposed Fix]
    In the 'apt' source package (debian/control), add the appropriate Breaks 
relation:
  
    Package: libapt-pkg7.0
    Breaks: apt (<< 3.2.0)
  
    This forces dpkg to unpack 'apt' and 'libapt-pkg7.0' synchronously, 
preventing the ABI mismatch window during release upgrades

ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: apt 3.2.0
ProcVersionSignature: Ubuntu 6.17.0-41.41-generic 6.17.13
Uname: Linux 6.17.0-41-generic x86_64
ApportVersion: 2.34.1-0ubuntu0.1
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Sun Sep  6 10:34:40 2026
RebootRequiredPkgs: Error: path contained symlinks.
SourcePackage: apt
UpgradeStatus: Upgraded to resolute on 2026-09-05 (1 days ago)

** Affects: apt (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug resolute wayland-session

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

Title:
  libapt-pkg7.0 3.2.0 causes apt symbol lookup error (missing Breaks:
  apt << 3.2.0) on do-release-upgrade

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


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

Reply via email to