dockerhub pull下来的Ubuntu:14.04镜像,apt update提示Hash Sum mismatch?

发布于 2022-09-04 02:08:30 字数 4461 浏览 23 评论 0

DockerHubpull了一个ubuntu:14.04的镜像:

但是进入到容器中执行apt update的时候提示Hash Sum mismatch

错误详情

Ign http://archive.ubuntu.com trusty InRelease       
Hit http://archive.ubuntu.com trusty-updates InRelease
Hit http://archive.ubuntu.com trusty-security InRelease
Hit http://archive.ubuntu.com trusty Release.gpg  
Get:1 http://archive.ubuntu.com trusty-updates/main Sources [1175 kB]
Get:2 http://archive.ubuntu.com trusty-updates/restricted Sources [1175 kB]    
Get:3 http://archive.ubuntu.com trusty-updates/universe Sources [1175 kB]      
Get:4 http://archive.ubuntu.com trusty-updates/main amd64 Packages [23.5 kB]   
Get:5 http://archive.ubuntu.com trusty-updates/restricted amd64 Packages [23.5 kB]
Get:6 http://archive.ubuntu.com trusty-security/main Sources [1175 kB]         
Get:7 http://archive.ubuntu.com trusty-updates/universe amd64 Packages [23.5 kB]
Get:8 http://archive.ubuntu.com trusty-security/restricted Sources [1175 kB]   
Get:9 http://archive.ubuntu.com trusty-security/universe Sources [1175 kB]     
Get:10 http://archive.ubuntu.com trusty-security/main amd64 Packages [23.5 kB] 
Get:11 http://archive.ubuntu.com trusty-security/restricted amd64 Packages [20.2 kB]
Get:12 http://archive.ubuntu.com trusty-security/universe amd64 Packages [23.5 kB]
Hit http://archive.ubuntu.com trusty Release                                   
Get:13 http://archive.ubuntu.com trusty/main Sources [1175 kB]
Get:14 http://archive.ubuntu.com trusty/restricted Sources [1175 kB]           
Get:15 http://archive.ubuntu.com trusty/universe Sources [1175 kB]             
Get:16 http://archive.ubuntu.com trusty/main amd64 Packages [16.4 kB]          
Get:17 http://archive.ubuntu.com trusty/universe amd64 Packages [7589 kB]      
Get:18 http://archive.ubuntu.com trusty/restricted amd64 Packages [16.0 kB]    
Fetched 10.7 MB in 3min 28s (51.4 kB/s)                                        
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/source/Sources  Hash Sum mismatch

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/restricted/source/Sources  Hash Sum mismatch

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/universe/source/Sources  Hash Sum mismatch

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/binary-amd64/Packages  Hash Sum mismatch

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/universe/binary-amd64/Packages  Hash Sum mismatch

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/main/source/Sources  Hash Sum mismatch

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/restricted/source/Sources  Hash Sum mismatch

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/universe/source/Sources  Hash Sum mismatch

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/main/binary-amd64/Packages  Hash Sum mismatch

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/universe/binary-amd64/Packages  Hash Sum mismatch

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/main/source/Sources  Hash Sum mismatch

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/restricted/source/Sources  Hash Sum mismatch

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/universe/source/Sources  Hash Sum mismatch

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/main/binary-amd64/Packages  Hash Sum mismatch

E: Some index files failed to download. They have been ignored, or old ones used instead.

到网上找了一些资料:

四种方法都试了,但是都没效果。

#1. 第一种方法
sudo apt-get clean  
sudo apt-get update --fix-missing 

#2. 第二种方法
# 删除  
sudo rm -fR /var/lib/apt/lists/*  
# 新建相应文件夹  
sudo mkdir /var/lib/apt/lists/partial  
# 重新update  
sudo apt-get update  

#3. 第三种方法
换源,阿里,CentOS,163的都试过

#4. 第四种方法

把http换成https但是也不行,提示apt-transport-https包没安装...但是没修复源的问题,也装不了...
E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?
E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?

不知道大家有没有碰到过这个问题,期待大家的解答,谢谢大家。

感觉可能是网络的原因,但是VPN老是断,不好使。找不到比较可靠的VPN...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

比忠 2022-09-11 02:08:30

貌似还是和镜像源相关,改成国内的,然后重启重新试一下。

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文