APT Hash sum mismatch错误的常见解决方法总结

当在Linux系统中遇到APT Hash sum mismatch错误时,这通常与软件包的校验和不匹配有关。常见的解决方案包括清理缓存、删除下载文件、更换更新源、设置下载格式、调整代理设置及修正时间戳。每种方法都有其适用场景,可根据具体情况尝试。
摘要由CSDN通过智能技术生成

APT Hash sum mismatch错误的常见解决方法总结

LINUX报这个错误的时候,有很多的原因,通常是出现在使用apt-get update的时候, apt 的全称是Advanced Packaging Tool。在apt版本1.2.0之前,它是有BUG的,后续版本修正了,或许可以通过直接升级apt版本解决。问题原因五花八门,中外网友们的解决办法也是多种多样。

Hash sum mismatch这个错误是什么意思?

  apt repository metadata is organized in such a way that a top level file contains the checksums of other pieces of repository metadata.
 The “Hash sum mismatch” error indicates to the user that apt has run a checksum against the repository metadata it has downloaded and the checksum apt computed does not match the checksum listed in the top level file.
Unfortunately, due to a bug in apt, metadata files compressed with lzma (.xz files) are occasionally downloaded (and in some cases) decompressed incorrectly resulting in a broken file.     As a result, the checksum of the broken file will be incorrect and cause apt to produce the “Hash sum mismatch” error.

这里写图片描述

Hash sum mismatch 为何产生?

There are at least 3 ways this can happen for most Ubuntu and Debian based systems today:

Stale metadata cached between the client and server. This is unlikely in most cases and not possible if SSL is used.
The metadata does not match because of a bug during the extraction of the metadata.
The repository is being updated while an apt-get update is run, or apt has cached a stale Release file.

Users can avoid all 3 cases by: (如何避免?)

Using SSL.
Disabling XZ compressed metadata, or ensuring a newer version of APT is used.
Using the new Acquire-by-hash featur
  • 7
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值