Kali Linux 上的“sudo apt update && sudo apt full-upgrade -y”失败

Kali Linux 上的“sudo apt update && sudo apt full-upgrade -y”失败

我正在尝试更新和升级卡利Linuxsudo apt update && sudo apt full-upgrade -y我收到以下问题。我怎么解决这个问题?任何人都可以帮助我,拜托。

┌──(kali㉿`enter code here`)-[~]
└─$ sudo apt update && sudo apt full-upgrade -y
Get:1 http://ftp.harukasan.org/kali kali-rolling InRelease [30.6 kB]
Get:2 http://ftp.harukasan.org/kali kali-rolling/non-free Sources [123 kB]
Get:3 http://ftp.harukasan.org/kali kali-rolling/contrib Sources [66.3 kB]
Get:4 http://ftp.harukasan.org/kali kali-rolling/main Sources [14.4 MB]
Get:5 http://ftp.harukasan.org/kali kali-rolling/main amd64 Packages [18.0 MB]
Get:6 http://ftp.harukasan.org/kali kali-rolling/main amd64 Contents (deb) [40.9 MB]
Get:6 http://ftp.harukasan.org/kali kali-rolling/main amd64 Contents (deb) [40.9 MB]
Get:6 http://ftp.harukasan.org/kali kali-rolling/main amd64 Contents (deb) [40.9 MB]
Ign:6 http://ftp.harukasan.org/kali kali-rolling/main amd64 Contents (deb)
Err:6 http://http.kali.org/kali kali-rolling/main amd64 Contents (deb)      
  File has unexpected size (40914837 != 40904768). Mirror sync in progress? [IP: 118.38.178.199 80]
Get:9 http://ftp.harukasan.org/kali kali-rolling/contrib amd64 Contents (deb) [129 kB]
Ign:9 http://ftp.harukasan.org/kali kali-rolling/contrib amd64 Contents (deb)   
Err:6 http://http.kali.org/kali kali-rolling/main amd64 Contents (deb)                                 
  File has unexpected size (40914837 != 40904768). Mirror sync in progress? [IP: 118.38.178.199 80]
Get:10 http://ftp.harukasan.org/kali kali-rolling/non-free amd64 Contents (deb) [949 kB]               
Ign:10 http://ftp.harukasan.org/kali kali-rolling/non-free amd64 Contents (deb)
Ign:9 http://http.kali.org/kali kali-rolling/contrib amd64 Contents (deb)
Reading package lists... Done                       
E: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/main/Contents-amd64  File has unexpected size (40914837 != 40904768). Mirror sync in progress? [IP: 118.38.178.199 80]
E: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/contrib/Contents-amd64  File has unexpected size (154305 != 128561). Mirror sync in progress? [IP: 118.38.178.199 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
                                                                                            

卡利版本:

No LSB modules are available.
Distributor ID: Kali
Description:    Kali GNU/Linux Rolling
Release:        2022.1
Codename:       kali-rolling

到目前为止我尝试过的:

  • 以下命令来自阿库本图

     sudo cp /etc/apt/sources.list ~/ 
     sudo wget "http://pastebin.com/raw.php?i=uzhrtg5M" -O /etc/apt/sources.list 
     sudo apt-get update
     sudo rm /etc/apt/sources.list.d/ubuntu-extras.list
     sudo apt-get update
    
  • sudo apt-get upgradesudo apt-get upgrade -f来自阿库本图

     apt-get clean
    

我读过很多文章,但提到的解决方案都不适合我。任何帮助,将不胜感激

答案1

错误消息看起来很清楚:

File has unexpected size (40914837 != 40904768). Mirror sync in progress? [IP: 118.38.178.199 80]

您用来下载更新的镜像正在从其上游源同步。稍后重试或暂时使用不同的镜像

答案2

无论失败文件的具体问题是什么,Contents处理包或包升级都不需要这些文件。除了所需的文件之外,还下载了它们,以便使用该包apt-file(Debian:apt-file)以便轻松搜索任意包内容,即使该包未安装并且它们通常很大。

因此,要解决此问题,直到 dist 升级完成,只需删除apt-file

apt-get purge apt-file

您仍然可以稍后重新安装它,看看它是否可以正常工作。

或者,可以按照此处所述暂时禁用它,而不是删除该包:apt - 如何禁用内容文件的获取?

相关内容