software-properties-qt does not load driver information

Bug #1965811 reported by Erich Eickmeyer
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Fix Released
Critical
Unassigned
Jammy
Fix Released
Critical
Unassigned

Bug Description

Driver information is not being loaded by software-properties-qt. This appears to be a python issue, perhaps a python 3.10 compatibility issue.

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/softwareproperties/qt/SoftwarePropertiesQt.py", line 1024, in detect_drivers
    self.devices = detect.system_device_drivers(self.apt_cache)
  File "/usr/lib/python3/dist-packages/UbuntuDrivers/detect.py", line 752, in system_device_drivers
    for pkg, pkginfo in system_driver_packages(apt_cache, sys_path,
  File "/usr/lib/python3/dist-packages/UbuntuDrivers/detect.py", line 448, in system_driver_packages
    for p in packages_for_modalias(apt_cache, alias):
  File "/usr/lib/python3/dist-packages/UbuntuDrivers/detect.py", line 200, in packages_for_modalias
    apt_cache_hash = hash(package.get_fullname() for package in apt_cache.packages)
AttributeError: 'Cache' object has no attribute 'packages'
Exception ignored in: <function DetectDriverThread.__del__ at 0x7f9aaf4371c0>

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: software-properties-qt 0.99.19
ProcVersionSignature: Ubuntu 5.15.0-22.22-lowlatency 5.15.19
Uname: Linux 5.15.0-22-lowlatency x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu79
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: KDE
Date: Mon Mar 21 11:34:54 2022
InstallationDate: Installed on 2021-03-20 (365 days ago)
InstallationMedia: Ubuntu-Studio 21.04 "Hirsute Hippo" - Alpha amd64 (20210320)
PackageArchitecture: all
SourcePackage: software-properties
UpgradeStatus: Upgraded to jammy on 2021-11-07 (134 days ago)

Revision history for this message
Erich Eickmeyer (eeickmeyer) wrote :
Changed in software-properties (Ubuntu):
importance: Undecided → Critical
Revision history for this message
Darin Miller (darinmiller) wrote :

Not an expert here, but the problem appears to be the import apt line 58 in SoftwarePropertiesQt.py.

apt.Cache() lacks the packages attribute.

Replacing apt with apt_pkg (as seen in the detect.py package and to which the apt_cache is passed) should fix the problem.

apt is only called twice in SoftwarePropertiesQt.py and both times, it is used (incorrectly) as follows:

self.apt_cache = apt.Cache()

If this is the correct approach to fix this issue, I will attempt to submit a patch.

Revision history for this message
Sebastien Bacher (seb128) wrote :
Revision history for this message
Erich Eickmeyer (eeickmeyer) wrote :

That does indeed seem to fix the problem, Sebastien. :)

Changed in software-properties (Ubuntu Jammy):
status: New → Fix Committed
Changed in software-properties (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Pascal Tempier (orogor) wrote :

Hello

@eeickmeyer do you know the status of this issue in ubuntu-drivers-common ?

This bug is present when installing supplémentary packages and detecting an nvidia card on 22.04.2.

Here is a workaround we use that sometime works :

sed -i.orig "s/version = int(package_name.split('-')[-1])/version = int(package_name.split('-')[-2])/" /usr/lib/python3/dist-packages/UbuntuDrivers/detect.py

Revision history for this message
Erich Eickmeyer (eeickmeyer) wrote :

Pascal,

This is a very old bug that was closed as fixed and should not be necro-bumped. If you're noticing something new, open a new bug report.

Furthermore, bug reports are not places for technical support.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.