kali配置apt源

文章介绍了在安装KaliLinux后,如何通过vim编辑器修改/etc/apt/sources.list文件,切换到阿里云的APT源。接着,由于缺少证书导致的错误,文章指导了使用apt-key添加证书来解决。然后,展示了成功运行apt-getupdate的命令,但过程中遇到了镜像同步导致的文件尺寸不符问题。
摘要由CSDN通过智能技术生成

安装好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,耗时 19(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]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Jie_Chang

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值