当我尝试打开软件中心时,它一片空白,5 秒后就崩溃了。我尝试卸载它,然后通过终端重新安装,但没有成功。
software-center
终端的输出:
SystemError: E:Encountered a section with no Package: header, E:Problem with MergeList /var/lib/apt/lists/repository.spotify.com_dists_stable_non-free_i18n_Translation-sv, E:Paketlistan eller statusfilen kunde inte tolkas eller öppnas.
2015-11-03 20:23:40,237 - softwarecenter.db.enquire - ERROR - _get_estimate_nr_apps_and_nr_pkgs failed
Traceback (most recent call last):
File "/usr/share/software-center/softwarecenter/db/enquire.py", line 115, in _get_estimate_nr_apps_and_nr_pkgs
tmp_matches = enquire.get_mset(0, len(self.db), None, xfilter)
File "/usr/share/software-center/softwarecenter/db/appfilter.py", line 89, in __call__
if (not pkgname in self.cache and
File "/usr/share/software-center/softwarecenter/db/pkginfo_impl/aptcache.py", line 281, in __contains__
return self._cache.__contains__(k)
AttributeError: 'NoneType' object has no attribute '__contains__'
Traceback (most recent call last):
File "/usr/bin/software-center", line 183, in <module>
app.run(args)
File "/usr/share/software-center/softwarecenter/ui/gtk3/app.py", line 1378, in run
self.show_available_packages(args)
File "/usr/share/software-center/softwarecenter/ui/gtk3/app.py", line 1316, in show_available_packages
self.view_manager.set_active_view(ViewPages.AVAILABLE)
File "/usr/share/software-center/softwarecenter/ui/gtk3/session/viewmanager.py", line 150, in set_active_view
view_widget.init_view()
File "/usr/share/software-center/softwarecenter/ui/gtk3/panes/availablepane.py", line 227, in init_view
self.cache, self.db, self.icons, self.apps_filter)
File "/usr/share/software-center/softwarecenter/ui/gtk3/views/lobbyview.py", line 80, in __init__
self.build()
File "/usr/share/software-center/softwarecenter/ui/gtk3/views/lobbyview.py", line 326, in build
self._build_homepage_view()
File "/usr/share/software-center/softwarecenter/ui/gtk3/views/lobbyview.py", line 121, in _build_homepage_view
self._append_whats_new()
File "/usr/share/software-center/softwarecenter/ui/gtk3/views/lobbyview.py", line 255, in _append_whats_new
whats_new_cat = self._update_whats_new_content()
File "/usr/share/software-center/softwarecenter/ui/gtk3/views/lobbyview.py", line 240, in _update_whats_new_content
docs = whats_new_cat.get_documents(self.db)
File "/usr/share/software-center/softwarecenter/db/categories.py", line 131, in get_documents
nonblocking_load=False)
File "/usr/share/software-center/softwarecenter/db/enquire.py", line 330, in set_query
self._blocking_perform_search()
File "/usr/share/software-center/softwarecenter/db/enquire.py", line 225, in _blocking_perform_search
matches = enquire.get_mset(0, self.limit, None, xfilter)
File "/usr/share/software-center/softwarecenter/db/appfilter.py", line 89, in __call__
if (not pkgname in self.cache and
File "/usr/share/software-center/softwarecenter/db/pkginfo_impl/aptcache.py", line 281, in __contains__
return self._cache.__contains__(k)
AttributeError: 'NoneType' object has no attribute '__contains__'
erik@erik-P35-DS3P:~$ Traceback (most recent call last):
File "/usr/share/software-center/update-software-center-agent", line 81, in <module>
cache = apt.Cache(memonly=True)
File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 107, in __init__
self.open(progress)
File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 151, in open
self._cache = apt_pkg.Cache(progress)
SystemError: E:Encountered a section with no Package: header, E:Problem with MergeList /var/lib/apt/lists/repository.spotify.com_dists_stable_non-free_i18n_Translation-sv, E:Paketlistan eller statusfilen kunde inte tolkas eller öppnas.
输出LANG=C software-center
:
2015-11-03 20:33:55,461 - softwarecenter.ui.gtk3.app - INFO - setting up proxy 'None'
2015-11-03 20:33:57,683 - softwarecenter.region - WARNING - failed to use geoclue: 'org.freedesktop.Geoclue.Error.notAvailable: Geoclue master client has no usable Address providers'
2015-11-03 20:33:58,598 - softwarecenter.backend.reviews - WARNING - Could not get usefulness from server, no username in config file
答案1
我认为以下两个命令应该可以解决您的问题:
sudo rm -rf /var/lib/apt/lists/*
sudo apt-get update
第一个命令将删除所有下载的包索引文件,而第二个命令将重新下载所有文件。
可能是错误的软件包列表导致了您的问题。
笔记:下载需要一段时间,具体取决于您的连接速度。如果您愿意,可以先尝试最低限度的干预,只需删除错误消息中提到的文件:
sudo rm /var/lib/apt/lists/repository.spotify.com_dists_stable_non-free_i18n_Translation-sv
sudo apt-get update
答案2
1)从应用程序>附件>终端打开终端
然后输入
gksudo software-center
如果它做了同样的事情,你至少会得到一个错误的文本输出。把它发回这里。
2)这是另一种解决方法:
请删除 cairo 和 gusty 所在的行。要执行此操作,请键入
nano /etc/apt/sources.list
(第 60 行,其中包含 gusty)并像之前一样保存文件。
Gusty 已经很旧了,并且不再受支持。
亲切的问候