You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Kali Linux执行apt update时出现403 Forbidden错误求助

Kali Linux执行apt update时出现403 Forbidden错误求助

问题描述

我最近安装了Kali Linux,但是执行apt update命令时遇到了403 Forbidden错误,具体报错信息如下:

└─$ sudo apt update
Err:1 http://kali.download/kali kali-rolling InRelease
  403  Forbidden [IP: 104.17.253.239 80]
Err:2 http://kali.download/kali kali-experimental InRelease
  403  Forbidden [IP: 104.17.253.239 80]
Reading package lists... Done
E: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease  403  Forbidden [IP: 104.17.253.239 80]
E: The repository 'http://http.kali.org/kali kali-rolling InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://http.kali.org/kali/dists/kali-experimental/InRelease  403  Forbidden [IP: 104.17.253.239 80]
E: The repository 'http://http.kali.org/kali kali-experimental InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

解决方案

我之前碰到过完全一样的问题,试了下面几个方法就解决了,你可以挨个试试:

  • 将HTTP源替换为HTTPS
    Kali官方现在逐渐不再支持HTTP访问源仓库,HTTP请求会被直接返回403。修改源配置文件的步骤如下:

    1. 打开终端执行:sudo nano /etc/apt/sources.list
    2. 把文件里所有以http://开头的源地址替换成https://,比如把http://kali.download/kali改成https://kali.download/kali
    3. 按Ctrl+O保存,回车确认后,再按Ctrl+X退出编辑器
    4. 重新执行sudo apt update,看看是否解决问题
  • 更换为国内镜像源
    如果官方源访问还是有问题,可以试试国内的镜像源,比如清华镜像:

    1. 同样打开sudo nano /etc/apt/sources.list
    2. 清空原有内容,粘贴下面的源:
      deb https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main non-free contrib
      deb-src https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main non-free contrib
      
    3. 保存退出后执行sudo apt update
  • 检查网络设置

    • 关闭正在运行的代理或VPN,有时候代理会拦截源请求导致403错误
    • 尝试更换DNS服务器,比如改成谷歌DNS(8.8.8.8)或者Cloudflare DNS(1.1.1.1),避免DNS解析错误导致访问到错误的IP

备注:内容来源于stack exchange,提问作者Farzad Jahangiri

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.16 09:33:19