Ubuntu 12.04 中的软件中心立即崩溃

Ubuntu 12.04 中的软件中心立即崩溃

我在终端中打开它,出现以下错误:

2013-09-26 12:12:44,585 - softwarecenter.ui.gtk3.app - INFO - setting up proxy 'None'
2013-09-26 12:12:44,589 - softwarecenter.db.database - INFO - open() database: path=None use_axi=True use_agent=True
2013-09-26 12:12:44,678 - softwarecenter.backend.reviews - WARNING - Could not get usefulness from server, no username in config file
2013-09-26 12:12:44,738 - softwarecenter.ui.gtk3.app - INFO - show_available_packages: search_text is '', app is None.
2013-09-26 12:12:44,740 - softwarecenter.db.pkginfo_impl.aptcache - INFO - aptcache.open()
Traceback (most recent call last):
  File "/usr/bin/software-center", line 176, in <module>
    app.run(args)
  File "/usr/share/software-center/softwarecenter/ui/gtk3/app.py", line 1422, in run
    self.show_available_packages(args)
  File "/usr/share/software-center/softwarecenter/ui/gtk3/app.py", line 1352, in show_available_packages
    self.view_manager.set_active_view(ViewPages.AVAILABLE)
  File "/usr/share/software-center/softwarecenter/ui/gtk3/session/viewmanager.py", line 154, in set_active_view
    view_widget.init_view()
  File "/usr/share/software-center/softwarecenter/ui/gtk3/panes/availablepane.py", line 171, in init_view
    self.apps_filter)
  File "/usr/share/software-center/softwarecenter/ui/gtk3/views/catview_gtk.py", line 238, in __init__
    self.build(desktopdir)
  File "/usr/share/software-center/softwarecenter/ui/gtk3/views/catview_gtk.py", line 511, in build
    self._build_homepage_view()
  File "/usr/share/software-center/softwarecenter/ui/gtk3/views/catview_gtk.py", line 257, in _build_homepage_view
    self._append_banner_ads()
  File "/usr/share/software-center/softwarecenter/ui/gtk3/views/catview_gtk.py", line 372, in _append_banner_ads
    scagent.query_exhibits()
  File "/usr/share/software-center/softwarecenter/backend/scagent.py", line 119, in query_exhibits
    lang=get_language(), series=self.distro.get_codename())
  File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 92, in get_codename
    self._distro_code_name = distro_info['CODENAME']
KeyError: 'CODENAME'

有人知道如何解决这个问题吗?谢谢

答案1

尝试卸载并重新安装软件中心。

要卸载软件中心:

sudo apt-get remove software-center

sudo apt-get autoremove software-center

要重新安装软件中心:

sudo apt-get update

sudo apt-get install software-center

答案2

为我工作


$ diff -u /usr/share/software-center/softwarecenter/distro/__init__.py-201401020102 /usr/share/software-center/softwarecenter/distro/__init__.py
--- /usr/share/software-center/softwarecenter/distro/__init__.py-201401020102   2014-02-02 01:03:59.812302279 -0300
+++ /usr/share/software-center/softwarecenter/distro/__init__.py    2014-02-02 01:04:34.603927639 -0300
@@ -85,10 +85,8 @@
             return distrocode
         # normal behavior
         if not hasattr(self, "_distro_code_name"):
-            try:
-                distro_info = lsb_release.get_distro_information(True)
-            except:
-                distro_info = lsb_release.get_distro_information()
+            # lsb_release.get_distro_information(True) returns OS key instead of CODENAME
+            distro_info = lsb_release.get_distro_information()
             self._distro_code_name = distro_info['CODENAME']
         return self._distro_code_name

相关内容