我无法运行 sudo apt-get update,一直出现以下错误:
#apt-get update
Ign:1 http://kali.download/kali kali-rolling InRelease
Ign:1 http://kali.download/kali kali-rolling InRelease
Ign:1 http://kali.download/kali kali-rolling InRelease
Err:1 http://kali.download/kali kali-rolling InRelease
Could not resolve 'kali.download'
Reading package lists... Done
W: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease Could not resolve 'kali.download'
W: Some index files failed to download. They have been ignored, or old ones used instead.
我在其他帖子中看到,可以通过修改etc/apt/sources.list
添加的“ deb http://http.kali.org/kali kali-last-snapshot main contrib non-free
”或“ deb https://http.kali.org/kali kali-rolling main contrib non-free
”来解决这个问题。
我尝试过这个解决方案,但它并没有解决我的问题。
我还注意到,其他用户通常无法获取 kali.org,但就我而言,是 kali.download。
我可以在浏览器中看到索引http://http.kali.org/kali/dists/kali-rolling正确,但无法下载 InRelease。
对此有什么提示吗?
答案1
错误:尝试运行时apt update
,如果失败并出现错误:
Ign:1 http://kali.download/kali kali-rolling InRelease
Ign:1 http://kali.download/kali kali-rolling InRelease
Ign:1 http://kali.download/kali kali-rolling InRelease
Err:1 http://kali.download/kali kali-rolling InRelease
Could not resolve 'kali.download'
Reading package lists... Done
W: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease Could not resolve 'kali.download'
W: Some index files failed to download. They have been ignored, or old ones used instead.
要检查是否是同一原因,请运行以下命令:
nslookup kali.download 8.8.8.8
它应该给出如下输出:
Server: 212.166.132.192
Address: 212.166.132.192#53
Non-authoritative answer:
kali.download canonical name = security.mac.vodafone.es.
为了解决这个问题,您应该从 ISP 客户端平台上停用“SecureNet”功能。
答案2
如果您像我一样,问题在于使用/etc/apt/source.list
withhttps
而不是 plain http
。
删除它对s
我来说就完成了工作。
答案3
我可以解决这个问题,用 https 代替 http/etc/apt/source.list
这是我的 source.list
deb https://http.kali.org/kali kali-rolling main contrib non-free non-free-firmware
deb https://http.kali.org/kali kali-last-snapshot main contrib non-free non-free-firmware
deb https://http.kali.org/kali kali-experimental main contrib non-free non-free-firmware
deb https://http.kali.org/kali kali-bleeding-edge main contrib non-free non-free-firmware
deb-src https://http.kali.org/kali kali-rolling main contrib non-free non-free-firmware
我也在使用 WSL2。