解决 Kali Linux 中 apt-get install 的问题: E: Unable to locate package xxx

在学习使用Kali Linux的过程中,由于新版Kali Linux 不再自带 BeEF,所以打算用apt-get install 安装一个 BeEF,即命令行输入:

sudo apt-get install beef-xss

然而会报错:E: Unable to locate package beef-xss

这是因为我们的Kali Linux中当前的apt资源列表中找不到该包。

解决办法,更改apt的资源列表。

1. 编辑 /etc/apt/sources.list文件:

sudo vim /etc/apt/sources.list 

2. 添加旧的资源信息:

deb http://http.kali.org/kali kali-rolling main contrib non-free
# For source package access, uncomment the following line
# deb-src http://http.kali.org/kali kali-rolling main contrib non-free
deb http://http.kali.org/kali sana main non-free contrib
deb http://security.kali.org/kali-security sana/updates main contrib non-free
# For source package access, uncomment the following line
# deb-src http://http.kali.org/kali sana main non-free contrib
# deb-src http://security.kali.org/kali-security sana/updates main contrib non-free
deb http://old.kali.org/kali moto main non-free contrib
# For source package access, uncomment the following line
# deb-src http://old.kali.org/kali moto main non-free contrib

3. 更新资源列表:

sudo apt-get update

更新完毕后重新安装目标应用即可。

posted @ 2020-12-31 16:14  DGSX  阅读(3590)  评论(0编辑  收藏  举报