Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm using Ubuntu 12.10. Yesterday I noticed that software-properties-gtk does not work anymore. I have no idea why and what to do. When I start via Terminal I get the following output:

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:~$ 

What I want to do is to completely reinstall the proprietary ATI graphic drivers, because the game DungeonDefenders does not start. Also software-properties-gtk is useful to manage repositories.

I thought about to apt-get purge software-properties-gtk but I'm not sure whether this is safe or I'd break something.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

I had the same problem but clearing cache didn't sort it. It turned out to be a known issue. Read through it, I could fix it doing the following:

  1. to find the offending character:

    iconv -f utf8 -t ucs-2le /var/lib/dpkg/status  >/dev/null || echo "non-UTF-8 found"
    
  2. removing the offending non-UTF8 character, you should be able to find the character with vim or nano from the line number reported above.

Hope that helps.

share|improve this answer
    
I used nano. Your command didn't work correctly, though. Maybe because there were several characters wrong. But I found them. I noticed that the wrong characters were caused by the official repository of "back to the roots (bttr)", an "the settlers2" clone. I removed the repository, searched for the word "settler", this way I found the characters really fast. Gedit and find/replace would have surely been faster. Or a Script. All characters were supposed to be a 'ü', but were broke somehow. But everything works now. –  chocobai Jan 5 '13 at 23:52
add comment

It seems your local cache is corrupted. You can try running sudo apt-get update to update the cache. If that fails, you may need to clean out /var/cache/apt/ and then run sudo apt-get update to recover.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.