Linux

apt 命令不更新最新包(kali linux)

  • May 24, 2021

首先,我在嘗試安裝新軟體包時遇到了以下錯誤。

sudo apt-get install mpack   
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
 mail-transport-agent inews
The following NEW packages will be installed:
 mpack
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 36.4 kB of archives.
After this operation, 93.2 kB of additional disk space will be used.
Err:1 http://http.kali.org/kali kali-rolling/main amd64 mpack amd64 1.6-8.2
 404  Not Found [IP: 192.99.200.113 80]
E: Failed to fetch http://http.kali.org/kali/pool/main/m/mpack/mpack_1.6-8.2_amd64.deb  404  Not Found [IP: 192.99.200.113 80]

這只是我嘗試安裝**的許多軟體包中的一個範例。**他們都因相同的錯誤而失敗(獲取舊的不存在的包版本)

我注意到錯誤說我無法訪問“http://http.kali.org/kali/pool/main/m/mpack/mpack_1.6-8.2_amd64.deb”(在最後一行)

因此,我嘗試直接在瀏覽器上訪問該 URL,但未找到 404。接下來我在URL上倒退了一步,於是我去了“http://http.kali.org/kali/pool/main/m/mpack/”,發現沒有這個**“mpack_1. 6-8.2_amd64.deb”版本。我的 kali 應該獲取的文件是“mpack_1.6-17_amd64.deb”**(它在 mpack 路徑上)

我確認我有一個正確的 sources.list 文件並執行了 apt 更新。

我的 sources.list 包含這兩行應該是正確的,不應該是這裡的問題。

deb http://http.kali.org/kali kali-rolling main non-free contrib
deb-src http://http.kali.org/kali kali-rolling main contrib non-free

我執行了很多次的命令是:

apt update
apt-get update
sudo apt update
sudo apt-get update

所以我很困惑,為什麼我的kali仍然不斷地獲取它不存在的舊包,並向我拋出錯誤404 not found?

或者有人遇到過同樣的問題嗎?

sudo apt update結果:

$ sudo apt update
Get:1 http://mirror.kku.ac.th/kali kali-rolling InRelease [30.5 kB]
Get:2 http://mirror.kku.ac.th/kali kali-rolling/non-free Sources [135 kB]
Get:3 http://mirror.kku.ac.th/kali kali-rolling/main Sources [12.7 MB]
Get:4 http://mirror.kku.ac.th/kali kali-rolling/contrib Sources [63.7 kB]
Get:5 http://mirror.kku.ac.th/kali kali-rolling/main amd64 Packages [17.1 MB]
Get:6 http://mirror.kku.ac.th/kali kali-rolling/main amd64 Contents (deb) [36.3 MB]
Get:7 http://mirror.kku.ac.th/kali kali-rolling/contrib amd64 Packages [105 kB]
Get:8 http://mirror.kku.ac.th/kali kali-rolling/contrib amd64 Contents (deb) [105 kB]
Get:9 http://mirror.kku.ac.th/kali kali-rolling/non-free amd64 Packages [188 kB]
Get:10 http://mirror.kku.ac.th/kali kali-rolling/non-free amd64 Contents (deb) [911 kB]
Fetched 67.7 MB in 8s (8,332 kB/s)                                                                                                                                                                                 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.

鏡像已http://mirror.kku.ac.th/kali過時,提供舊版本mpack_1.6-8.2。您可以從Kali Mirrors中選擇不同的鏡子。

使用以下命令:

printf "%s\n" "deb http://mirror.easylee.nl/kali/ kali-rolling main non-free contrib" |\
sudo tee /etc/apt/sources.list
sudo apt update
sudo apt install mpack

引用自:https://unix.stackexchange.com/questions/651052