當發生以下kali apt update failed to fetch時,修復辦法。

當發生以下kali apt update failed to fetch時

1
2
3
4
5
6
7
8
Err:1 http://http.kali.org/kali kali-rolling InRelease
403 Forbidden [IP: 192.99.200.113 80]
Reading package lists... Done
E: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease 403 Forbidden [IP: 192.99.200.113 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.

原因

由於預設是走http未加密的方式更新,但是kali現在會強制要求要進行加密連線https,因此出現錯誤。

修復辦法

1
sudo vim  /etc/apt/sources.list

將下列

1
2
3
4
5
6
# See https://www.kali.org/docs/general-use/kali-linux-sources-list-repositories/
deb http://http.kali.org/kali kali-rolling main contrib non-free

# Additional line for source packages
# deb-src http://http.kali.org/kali kali-rolling main contrib non-free

改為
1
2
3
4
5
# See https://www.kali.org/docs/general-use/kali-linux-sources-list-repositories/
deb https://http.kali.org/kali kali-rolling main contrib non-free

# Additional line for source packages
# deb-src https://http.kali.org/kali kali-rolling main contrib non-free

參考資料

  1. https://kalitut.com/how-to-update-kali-linux-and-fix-update/
  2. https://linuxconfig.org/kali-linux-failed-to-fetch-inrelease-repository-fix