将Kali Linux官方存储库添加到sources.list

从ISO文件安装Kali Linux之后,您可能需要使用正式的存储库列表手动更新APT sources.list文件。本指南说明了如何将Kali Linux apt存储库添加到sources.list。

Apt需要软件存储库才能在您的计算机上下载并安装软件包。通过Kali Linux的滚动发行版来做到这一点 2019.4。让我们开始吧。

$ cat /etc/os-release 
PRETTY_NAME="Kali GNU/Linux Rolling"
NAME="Kali GNU/Linux"
ID=kali
VERSION="2019.4"
VERSION_ID="2019.4"
VERSION_CODENAME="kali-rolling"
ID_LIKE=debian
ANSI_COLOR="1;31"
HOME_URL="https://www.kali.org/"
SUPPORT_URL="https://forums.kali.org/"
BUG_REPORT_URL="https://bugs.kali.org/"

以root或用户身份登录到计算机并启动终端。

在终端中,检查系统上存在的apt存储库的当前列表。

$ cat /etc/apt/sources.list

如果APT存储库不存在,请粘贴以下代码并添加它。

sudo tee -a /etc/apt/sources.list<

上面的命令添加了标准和源存储库 /etc/apt/sources.list。确认已添加。

$ cat /etc/apt/sources.list
# 

# deb cdrom:[Debian GNU/Linux 2019.4 _Kali-rolling_ - Official Snapshot amd64 LIVE/INSTALL Binary 20191125-10:47]/ kali-last-snapshot contrib main non-free

#deb cdrom:[Debian GNU/Linux 2019.4 _Kali-rolling_ - Official Snapshot amd64 LIVE/INSTALL Binary 20191125-10:47]/ kali-last-snapshot contrib main non-free

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.
deb http://http.kali.org/kali kali-rolling main non-free contrib
deb-src http://http.kali.org/kali kali-rolling main non-free contrib

更新软件包列表。

$ sudo apt update
Get:1 http://kali.download/kali kali-rolling InRelease [30.5 kB]
Get:2 http://kali.download/kali kali-rolling/main Sources [12.8 MB]
Get:3 http://kali.download/kali kali-rolling/non-free Sources [130 kB]                                                                                 
Get:4 http://kali.download/kali kali-rolling/contrib Sources [60.1 kB]                                                                                 
Get:5 http://kali.download/kali kali-rolling/main amd64 Packages [16.4 MB]                                                                             
Get:6 http://kali.download/kali kali-rolling/non-free amd64 Packages [196 kB]                                                                          
Get:7 http://kali.download/kali kali-rolling/contrib amd64 Packages [96.6 kB]                                                                          
Fetched 29.7 MB in 24s (1,237 kB/s)                                                                                                                    
Reading package lists... Done
Building dependency tree       
Reading state information... Done
597 packages can be upgraded. Run 'apt list --upgradable' to see them.

可选系统升级

sudo apt -y upgrade
sudo systemctl reboot

添加更多有关Kali Linux的文章。因此,请检查您的网站上是否有新内容。

相关文章:

将Debian 10 Buster官方存储库添加到sources.list

在Debian和/ Ubuntu Linux上安装add-apt-repository

Sidebar