昨天在ubuntu的中安裝了一下“Python版webqq客戶端”程序,結果今天更新了系統重啟後,發現ubuntu軟件中心打不開了,在網上找到了如下解決辦法。
初步判斷是因為安裝那個webqq客戶端的時候,添加了linuxdeepin(深度)的軟件源導致的。
gongstring@chz-desktop:~$ software-center
Traceback (most recent call last):
File "/usr/bin/software-center", line 149, in
from softwarecenter.ui.gtk3.app import SoftwareCenterAppGtk3
File "/usr/share/software-center/softwarecenter/ui/gtk3/app.py", line 49, in
from softwarecenter.db.application import Application
File "/usr/share/software-center/softwarecenter/db/application.py", line 25, in
from softwarecenter.backend.channel import is_channel_available
File "/usr/share/software-center/softwarecenter/backend/channel.py", line 25, in
from softwarecenter.distro import get_distro
File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 165, in
distro_instance=_get_distro()
File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 148, in _get_distro
module = __import__(distro_id, globals(), locals(), [], -1)
ImportError: No module named LinuxDeepin
解決辦法如下:
sudo gedit /etc/lsb-release (好吧,我不會VIM -.-!)
用以下內容替換其中的文本:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.10
DISTRIB_CODENAME=oneiric
DISTRIB_DESCRIPTION=“Ubuntu 11.10″
OK,此時應該就可以打開軟件源、軟件中心了。
不過還是碰到了個問題,軟件中心是打開了,頁面卻一直處於空白的刷新界面。
卸載重裝:
sudo apt-get autoremove software-center --purge
顯示:
rmdir: 刪除 “/var/cache/software-center/xapian/” 失敗: 沒有那個文件或目錄
dpkg:處理 software-center (--purge)時出錯:
子進程 已安裝 post-removal 腳本 返回了錯誤號 1
在處理時有錯誤發生:
software-center
E: Sub-process /usr/bin/dpkg returned an error code (1)
查找了一下,cache文件夾下沒有software-center文件。
sudo mkdir /var/cache/software-center
sudo mkdir /var/cache/software-center/xapian
sudo apt-get autoremove software-center --purge
sudo apt-get install software-center
一切正常。