安装好kali之后使用apt源会造成无法使用的问题。
我们要这么做才可以真正的使用apt源?接下俩我们来配置。
1、首先我们要进入kali 使用vim或者vi命令进入/etc/apt/sources.list文件配置网络源
#阿里云
deb https://mirrors.aliyun.com/kali kali-rolling main non-free contrib
deb-src https://mirrors.aliyun.com/kali kali-rolling main non-free contrib
2、因为没有证书会进行报错,提示
3、要解决这个问题需要安装证书
apt-key add archive-key.asc
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
4、再去运行apt-get,发现已经可以使用apt了
┌──(root💀kali)-[/etc/apt]
└─# apt-get update -y
获取:1 https://mirrors.aliyun.com/kali kali-rolling InRelease [41.2 kB]
获取:2 https://mirrors.aliyun.com/kali kali-rolling/contrib Sources [77.2 kB]
获取:3 https://mirrors.aliyun.com/kali kali-rolling/main Sources [15.6 MB]
获取:4 http://mirrors.ustc.edu.cn/kali kali-rolling InRelease [41.2 kB]
获取:5 http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling InRelease [41.2 kB]
获取:6 http://mirrors.ustc.edu.cn/kali kali-rolling/contrib Sources [77.2 kB]
获取:7 http://mirrors.ustc.edu.cn/kali kali-rolling/main Sources [15.6 MB]
获取:8 http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling/non-free Sources [130 kB]
获取:9 https://mirrors.aliyun.com/kali kali-rolling/non-free Sources [130 kB]
获取:10 http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling/main Sources [15.6 MB]
获取:11 https://mirrors.aliyun.com/kali kali-rolling/main amd64 Packages [19.3 MB]
获取:12 https://mirrors.aliyun.com/kali kali-rolling/main amd64 Contents (deb) [44.5 MB]
获取:13 http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling/contrib Sources [77.2 kB]
获取:14 http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling/main amd64 Packages [19.3 MB]
获取:15 http://mirrors.ustc.edu.cn/kali kali-rolling/non-free Sources [130 kB]
获取:16 http://mirrors.ustc.edu.cn/kali kali-rolling/main amd64 Packages [19.3 MB]
获取:17 http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling/main amd64 Contents (deb) [44.5 MB]
获取:18 https://mirrors.aliyun.com/kali kali-rolling/non-free amd64 Packages [217 kB]
获取:19 https://mirrors.aliyun.com/kali kali-rolling/non-free amd64 Contents (deb) [928 kB]
获取:20 https://mirrors.aliyun.com/kali kali-rolling/contrib amd64 Packages [116 kB]
获取:21 https://mirrors.aliyun.com/kali kali-rolling/contrib amd64 Contents (deb) [172 kB]
获取:22 http://mirrors.ustc.edu.cn/kali kali-rolling/main amd64 Contents (deb) [44.5 MB]
错误:22 http://mirrors.ustc.edu.cn/kali kali-rolling/main amd64 Contents (deb)
文件尺寸不符(44472651 != 44472776)。您使用的镜像正在同步中? [IP: 202.141.176.110 80]
Hashes of expected file:
- Filesize:44472776 [weak]
- SHA256:9ba897422a46d3ab56008836ee2f0a02cd499b946a033c4e1a4904ab5e50b0d3
- SHA1:05ad52e9e9c4bfa69de77a721fa39807818b5ae1 [weak]
- MD5Sum:17f3a54cd4808a9da9e2a8ad7733c092 [weak]
Release file created at: Tue, 02 May 2023 18:04:22 +0000
获取:23 http://mirrors.ustc.edu.cn/kali kali-rolling/non-free amd64 Packages [217 kB]
获取:24 http://mirrors.ustc.edu.cn/kali kali-rolling/non-free amd64 Contents (deb) [928 kB]
获取:25 http://mirrors.ustc.edu.cn/kali kali-rolling/contrib amd64 Packages [116 kB]
获取:26 http://mirrors.ustc.edu.cn/kali kali-rolling/contrib amd64 Contents (deb) [172 kB]
获取:27 http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling/contrib amd64 Packages [116 kB]
获取:28 http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling/contrib amd64 Contents (deb) [172 kB]
获取:29 http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling/non-free amd64 Packages [217 kB]
获取:30 http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling/non-free amd64 Contents (deb) [928 kB]
错误:26 http://mirrors.ustc.edu.cn/kali kali-rolling/contrib amd64 Contents (deb)
已下载 199 MB,耗时 1分 9秒 (2,859 kB/s)
正在读取软件包列表... 完成
E: 无法下载 http://mirrors.ustc.edu.cn/kali/dists/kali-rolling/main/Contents-amd64.gz 文件尺寸不符(44472651 != 44472776)。您使用的镜像正在同步中? [IP: 202.141.176.110 80]