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

Kali Linux 2024.2执行apt更新升级时出现403 Forbidden错误的求助

Kali Linux 2024.2执行apt更新升级时出现403 Forbidden错误的求助

Hey Mohammad, sorry to hear you're stuck with this 403 Forbidden error while trying to update your new Kali 2024.2 system. Let's work through some practical fixes to get your updates running smoothly:

  • Fix your sources.list configuration first
    The error mentions the repo isn't signed and you're hitting a 403, which usually points to outdated or incorrect repo sources. Let's start by fixing this:

    1. Back up your current sources list to avoid messing things up:
      sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
      
    2. Edit the sources file with a text editor (nano is beginner-friendly):
      sudo nano /etc/apt/sources.list
      
    3. Clear out all existing lines and paste in the official HTTPS sources (note we're including non-free-firmware to match the component change notice you saw):
      deb https://http.kali.org/kali kali-rolling main non-free non-free-firmware
      deb-src https://http.kali.org/kali kali-rolling main non-free non-free-firmware
      
    4. Save and exit: Press Ctrl+O, hit Enter to confirm, then Ctrl+X to close nano.
  • Clear stale APT cache and re-run updates
    Old cached data might be causing conflicts. Let's wipe it and start fresh:

    1. Clean the local cache:
      sudo apt clean
      
    2. Try updating again:
      sudo apt update
      
    3. If you still see errors about missing files, run this to fix broken dependencies and missing repo data:
      sudo apt update --fix-missing
      
  • Check for network or proxy issues
    A 403 error can sometimes be caused by network restrictions (like a company firewall, campus network, or even a misconfigured proxy). Let's verify connectivity:

    1. Test if you can reach the Kali repo server:
      curl -I https://http.kali.org/kali/dists/kali-rolling/InRelease
      
    2. If you get a 403 Forbidden here too, your network might be blocking access. Try switching to a regional mirror. Replace the sources in sources.list with something like:
      deb https://mirrors.aliyun.com/kali kali-rolling main non-free non-free-firmware
      
    3. Make sure you don't have an unwanted proxy set up. Check for proxy variables with echo $http_proxy and echo $https_proxy — if they return values you didn't set, unset them with unset http_proxy and unset https_proxy, then try updating again.
  • Verify your system time is correct
    Incorrect system time can break repo signature verification. Let's sync your clock to the network:

    sudo timedatectl set-ntp true
    

    Check if the sync worked with:

    timedatectl status
    

    Look for "System clock synchronized: yes" in the output.

If you've tried all these steps and still run into issues, share the output of the curl command and any new error messages you get — that'll help narrow down the problem further.

备注:内容来源于stack exchange,提问作者Mohammad dehghani

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.16 08:48:05