终端打开软件中心显示ImportError: No module named LinuxDeepin解决方法

十二 17 2011 Published by under Linux/Ubuntu

软件中心有段时间打不开了,没怎么搭理,毕竟用的少,也就想起来就卸载重装一下。

昨天进入tty发现显示的版本信息竟然是LinuxDeepin!

Google,Ubuntu,WordPress,Linux

WTF!

好吧,本来这个没什么大不了的,爱显示啥显示啥,配合上这个:

a-nerd:~$ software-center
Traceback (most recent call last):
File "/usr/bin/software-center", line 149, in <module>
from softwarecenter.ui.gtk3.app import SoftwareCenterAppGtk3
File "/usr/share/software-center/softwarecenter/ui/gtk3/app.py", line 49, in <module>
from softwarecenter.db.application import Application
File "/usr/share/software-center/softwarecenter/db/application.py", line 25, in <module>
from softwarecenter.backend.channel import is_channel_available
File "/usr/share/software-center/softwarecenter/backend/channel.py", line 25, in <module>
from softwarecenter.distro import get_distro
File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 165, in <module>
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

 

嗯,ImportError: No module named LinuxDeepin,这就有点问题了。

同时软件源也打不开了,显示:

a-nerd:~$ software-properties-gtk
Traceback (most recent call last):
File "/usr/bin/software-properties-gtk", line 104, in <module>
app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
File "/usr/lib/python2.7/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 85, in __init__
SoftwareProperties.__init__(self, options=options, datadir=datadir)
File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 96, in __init__
self.reload_sourceslist()
File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 580, in reload_sourceslist
self.distro.get_sources(self.sourceslist)
File "/usr/lib/python2.7/dist-packages/aptsources/distro.py", line 91, in get_sources
raise NoDistroTemplateException("Error: could not find a "
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template

 

以ImportError: No module named LinuxDeepin为关键词Google到了Ubuntu中文论坛

原因很可能是添加了深度的PPA,hyhai7同学给出了解决方案:

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

一切正常。

over.

PS:如果TTY上还有残留,请修改/etc/issue文件。多谢nkiy提醒。,

本文链接地址: 终端打开软件中心显示ImportError: No module named LinuxDeepin解决方法



6 responses so far

发表评论