软件属性-gtk 无法启动

软件属性-gtk 无法启动

我正在使用 Ubuntu 12.10。昨天我注意到 software-properties-gtk 不再起作用。我不知道为什么以及该怎么办。当我通过终端启动时,我得到以下输出:

chocobai@pfubuntu:~$ software-properties-gtk 
gpg: /tmp/tmpgkhlnl/trustdb.gpg: trust-db erzeugt
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/UbuntuDrivers/detect.py", line 162, in packages_for_modalias
cache_map = packages_for_modalias.cache_maps[apt_cache_hash]
KeyError: 4726621

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/bin/software-properties-gtk", line 103, in <module>
app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 178, in __init__
self.init_drivers()
File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 1097, in init_drivers
self.devices = detect.system_device_drivers()
File "/usr/lib/python3/dist-packages/UbuntuDrivers/detect.py", line 415, in system_device_drivers
for pkg, pkginfo in system_driver_packages(apt_cache).items():
File "/usr/lib/python3/dist-packages/UbuntuDrivers/detect.py", line 319, in system_driver_packages
for p in packages_for_modalias(apt_cache, alias):
File "/usr/lib/python3/dist-packages/UbuntuDrivers/detect.py", line 164, in packages_for_modalias
cache_map = _apt_cache_modalias_map(apt_cache)
File "/usr/lib/python3/dist-packages/UbuntuDrivers/detect.py", line 129, in _apt_cache_modalias_map
m = package.candidate.record['Modaliases']
File "/usr/lib/python3/dist-packages/apt/package.py", line 429, in record
return Record(self._records.record)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 777: invalid start byte
chocobai@pfubuntu:~$ 

我想做的是完全重新安装专有的 ATI 图形驱动程序,因为游戏 DungeonDefenders 无法启动。此外,software-properties-gtk 还可用于管理存储库。

我考虑过使用 apt-get purge software-properties-gtk 但我不确定这是否安全或者我会破坏某些东西。

答案1

我也遇到过同样的问题,但清除缓存没有解决问题。原来这是一个已知的问题。通读一遍,我可以按照以下步骤修复它:

  1. 找到有问题的角色:

    iconv -f utf8 -t ucs-2le /var/lib/dpkg/status  >/dev/null || echo "non-UTF-8 found"
    
  2. 删除有问题的非 UTF8 字符,您应该能够使用 vim 或 nano 从上面报告的行号中找到该字符。

希望有所帮助。

答案2

您的本地缓存似乎已损坏。您可以尝试运行sudo apt-get update以更新缓存。如果失败,您可能需要清除缓存/var/cache/apt/,然后运行sudo apt-get update以恢复。

相关内容