我按照安装 kali linux 的说明进行操作,并将这些命令输入终端:
apt-get update
apt-get install software-center
我还补充道:
deb http://http.kali.org/ /kali main contrib non-free
deb http://http.kali.org/ /wheezy main contrib non-free
到我的来源列表。当我启动软件中心时,工具栏菜单中会出现一个标题为“启动软件中心”的选项卡,几秒钟后它就会关闭。没有出现任何窗口,也没有任何选项卡只是关闭。当我输入 sudo software-center 时,这会出现在终端中:
root@MattJones:~# sudo software-center Traceback (最近一次调用最后一次):
File "/usr/bin/software-center", line 131, 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 27, 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 179, in <module>
distro_instance=_get_distro()
File "/usr/share/software-center/softwarecenter/distro/__init__.py", line 162, in _get_distro
module = __import__(distro_id, globals(), locals(), [], -1)
ImportError: No module named Kali
有谁知道可能是什么问题?
答案1
请尝试以下步骤:
- 打开终端
- 类型
sudo apt-get update && sudo apt-get upgrade
- 类型
nano /etc/apt/sources.list
将您在问题中提到的存储库行以及以下行粘贴到该终端上:
deb-src http://http.kali.org/kali kali main non-free contrib deb http://http.kali.org/kali kali-dev main contrib non-free
按Ctrl+X然后Ctrl+Y然后Enter
- 类型
sudo apt-get update && sudo apt-get upgrade
- 类型
sudo apt-get install software-center
您还可以安装 synaptic,它是 Debian kali Linux 的包管理器。它也像一个软件中心
apt-get install synaptic
我认为问题确实出现了,因为可能没有升级你的kali(仅更新)
答案2
找到了解决方案:
gedit /usr/share/software-center/softwarecenter/distro/__init__.py
- 转到第 159 行
- 更改
lsb_info["ID"]
为"Debian"
之前:distro_id = lsb_info["ID"]
之后:distro_id = "Debian" - 在终端中输入:
update-software-center
- 现在应该可以工作了。
答案3
以防万一有人仍在努力寻找解决方案 以下命令对我有用。
这个想法是清理 gnome-softwares 的目录缓存对我来说它是在~/.cache/gnome-software
所以只需运行以下命令对我有用
rm -rf ~/.cache/gnome-software
我是如何找到该文件夹的?我只是运行以下命令来查找所有与缓存相关的文件夹
ls -R / | grep cache
答案4
这应该在您的 /etc/apt/sources.list 中
deb http://kali.download/kali/ kali-rolling main non-free contrib
deb http://ftp.debian.org/debian stable main contrib non-free
deb http://http.kali.org/kali kali-rolling main non-free contrib
deb http://http.kali.org/kali kali-last-snapshot main non-free contrib
deb http://http.kali.org/kali kali-experimental main non-free contrib
deb-src http://http.kali.org/kali kali-rolling main non-free contrib
然后:
apt-get update && apt-get install software-center
和: