昨天在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)
[Ok3w_NextPage]查找了一下,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
一切正常。