昨天在ubuntu的中安裝了一下“Python版webqq客戶端”程序,結(jié)果今天更新了系統(tǒng)重啟后,發(fā)現(xiàn)ubuntu軟件中心打不開了,在網(wǎng)上找到了如下解決辦法。
初步判斷是因?yàn)榘惭b那個(gè)webqq客戶端的時(shí)候,添加了linuxdeepin(深度)的軟件源導(dǎo)致的。
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 (好吧,我不會(huì)VIM -.-!)
用以下內(nèi)容替換其中的文本:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.10
DISTRIB_CODENAME=oneiric
DISTRIB_DESCRIPTION=“Ubuntu 11.10″
OK,此時(shí)應(yīng)該就可以打開軟件源、軟件中心了。
不過還是碰到了個(gè)問題,軟件中心是打開了,頁(yè)面卻一直處于空白的刷新界面。
卸載重裝:
sudo apt-get autoremove software-center --purge
顯示:
rmdir: 刪除 “/var/cache/software-center/xapian/” 失敗: 沒有那個(gè)文件或目錄
dpkg:處理 software-center (--purge)時(shí)出錯(cuò):
子進(jìn)程 已安裝 post-removal 腳本 返回了錯(cuò)誤號(hào) 1
在處理時(shí)有錯(cuò)誤發(fā)生:
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
一切正常。