无法获取 URL 哈希值不匹配 Ubuntu 18.04 LTS

无法获取 URL 哈希值不匹配 Ubuntu 18.04 LTS

我已经测试了所有答案此链接。不幸的是,它们都没有解决我的问题。

当我启动时apt update,它给了我:

Hit:1 http://ir.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://ir.archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:3 http://ir.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://ir.archive.ubuntu.com/ubuntu bionic-proposed InRelease [242 kB]                                                           
Hit:5 http://ir.archive.ubuntu.com/ubuntu bionic-backports InRelease                                                                   
Get:6 http://ir.archive.ubuntu.com/ubuntu bionic/multiverse Sources [181 kB]                                                           
Get:7 http://ir.archive.ubuntu.com/ubuntu bionic/restricted Sources [5,324 B]                                                          
Get:8 http://ir.archive.ubuntu.com/ubuntu bionic/universe Sources [9,051 kB]                                                           
Get:9 http://ir.archive.ubuntu.com/ubuntu bionic/main Sources [829 kB]                                                                 
Get:10 http://ir.archive.ubuntu.com/ubuntu bionic-security/restricted Sources [4,548 B]                                                
Get:11 http://ir.archive.ubuntu.com/ubuntu bionic-security/universe Sources [167 kB]                                                   
Get:12 http://ir.archive.ubuntu.com/ubuntu bionic-security/multiverse Sources [3,180 B]                                                
Get:13 http://ir.archive.ubuntu.com/ubuntu bionic-security/main Sources [143 kB]                                                       
Get:14 http://ir.archive.ubuntu.com/ubuntu bionic-security/main i386 Packages [442 kB]                                                 
Get:15 http://ir.archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages [651 kB]                                                
Get:16 http://ir.archive.ubuntu.com/ubuntu bionic-security/main Translation-en [211 kB]                                                
Get:17 http://ir.archive.ubuntu.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [38.5 kB]                                        
Get:18 http://ir.archive.ubuntu.com/ubuntu bionic-security/main DEP-11 48x48 Icons [17.6 kB]                                           
Get:19 http://ir.archive.ubuntu.com/ubuntu bionic-security/main DEP-11 64x64 Icons [41.5 kB]                                           
Get:20 http://ir.archive.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [23.8 kB]                                         
Get:21 http://ir.archive.ubuntu.com/ubuntu bionic-security/restricted i386 Packages [4,280 B]                                          
Get:22 http://ir.archive.ubuntu.com/ubuntu bionic-security/restricted Translation-en [6,528 B]                                         
Get:23 http://ir.archive.ubuntu.com/ubuntu bionic-security/universe i386 Packages [617 kB]                                             
Get:24 http://ir.archive.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [649 kB]                                            
Get:25 http://ir.archive.ubuntu.com/ubuntu bionic-security/universe Translation-en [218 kB]                                            
Get:26 http://ir.archive.ubuntu.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [42.1 kB]                                    
Get:27 http://ir.archive.ubuntu.com/ubuntu bionic-security/universe DEP-11 48x48 Icons [16.4 kB]                                       
Get:28 http://ir.archive.ubuntu.com/ubuntu bionic-security/universe DEP-11 64x64 Icons [111 kB]                                        
Get:29 http://ir.archive.ubuntu.com/ubuntu bionic-security/multiverse i386 Packages [4,292 B]                                          
Get:30 http://ir.archive.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [6,760 B]                                         
Get:31 http://ir.archive.ubuntu.com/ubuntu bionic-security/multiverse Translation-en [2,700 B]                                         
Get:32 http://ir.archive.ubuntu.com/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2,464 B]                                  
Get:32 http://ir.archive.ubuntu.com/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2,464 B]                                  
Get:34 http://ir.archive.ubuntu.com/ubuntu bionic-security/multiverse DEP-11 48x48 Icons [29 B]                                        
Get:35 http://ir.archive.ubuntu.com/ubuntu bionic-security/multiverse DEP-11 64x64 Icons [2,638 B]                                     
Get:36 http://ir.archive.ubuntu.com/ubuntu bionic-updates/main Sources [311 kB]                                                        
Get:36 http://ir.archive.ubuntu.com/ubuntu bionic-updates/main Sources [311 kB]                                                        
Get:36 http://ir.archive.ubuntu.com/ubuntu bionic-updates/main Sources [311 kB]                                                        
Get:36 http://ir.archive.ubuntu.com/ubuntu bionic-updates/main Sources [311 kB]                                                        
Get:36 http://ir.archive.ubuntu.com/ubuntu bionic-updates/main Sources [311 kB]                                                        
Get:36 http://ir.archive.ubuntu.com/ubuntu bionic-updates/main Sources [311 kB]                                                        
Get:36 http://ir.archive.ubuntu.com/ubuntu bionic-updates/main Sources [311 kB]                                                        
Get:36 http://ir.archive.ubuntu.com/ubuntu bionic-updates/main Sources [311 kB]                                                        
Get:36 http://ir.archive.ubuntu.com/ubuntu bionic-updates/main Sources [311 kB]                                                        
Get:45 http://ir.archive.ubuntu.com/ubuntu bionic-updates/multiverse Sources [5,840 B]                                                 
Get:46 http://ir.archive.ubuntu.com/ubuntu bionic-updates/restricted Sources [6,536 B]                                                 
Get:47 http://ir.archive.ubuntu.com/ubuntu bionic-updates/universe Sources [278 kB]                                                    
Get:48 http://ir.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [651 kB]                                                  
Err:48 http://ir.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages                                                           
  Hash Sum mismatch
  Hashes of expected file:
   - Filesize:650672 [weak]
   - SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   - SHA1:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [weak]
   - MD5Sum:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [weak]
  Hashes of received file:
   - SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   - SHA1:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [weak]
   - MD5Sum:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [weak]
   - Filesize:650672 [weak]
  Last modification reported: Sat, 07 Mar 2020 12:57:17 +0000
  Release file created at: Sat, 07 Mar 2020 14:34:50 +0000
Get:49 http://ir.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [871 kB]                                                 
Err:49 http://ir.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages                                                          
Get:50 http://ir.archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [326 kB]                                             
Get:51 http://ir.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [264 kB]                                      
Get:52 http://ir.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 48x48 Icons [193 kB]                                         
Get:53 http://ir.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 64x64 Icons [438 kB]                                         
Get:54 http://ir.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [10.1 kB]                                          
Get:55 http://ir.archive.ubuntu.com/ubuntu bionic-updates/multiverse i386 Packages [7,476 B]                                           
Get:56 http://ir.archive.ubuntu.com/ubuntu bionic-updates/multiverse Translation-en [4,636 B]                                          
Get:57 http://ir.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2,468 B]                                   
Get:58 http://ir.archive.ubuntu.com/ubuntu bionic-updates/multiverse DEP-11 48x48 Icons [29 B]                                         
Get:59 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/multiverse Sources [1,796 B]                                                
Get:60 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/universe Sources [20.5 kB]                                                  
Get:61 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/main Sources [66.6 kB]                                                      
Get:62 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/restricted Sources [5,592 B]                                                
Get:63 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/main amd64 Packages [111 kB]                                                
Get:64 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/main i386 Packages [82.0 kB]                                                
Get:65 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/main Translation-en [39.0 kB]                                               
Get:66 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/main amd64 DEP-11 Metadata [3,580 B]                                        
Get:67 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/main DEP-11 48x48 Icons [29 B]                                              
Get:68 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/main DEP-11 64x64 Icons [5,301 B]                                           
Get:69 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/restricted i386 Packages [7,820 B]                                          
Get:70 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/restricted amd64 Packages [16.8 kB]                                         
Get:71 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/restricted Translation-en [5,732 B]                                         
Get:72 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/universe amd64 Packages [141 kB]                                            
Get:73 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/universe i386 Packages [134 kB]                                             
Get:74 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/universe Translation-en [27.6 kB]                                           
Get:75 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/universe amd64 DEP-11 Metadata [13.1 kB]                                    
Get:76 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/universe DEP-11 48x48 Icons [5,921 B]                                       
Get:77 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/universe DEP-11 64x64 Icons [16.2 kB]                                       
Get:78 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/multiverse i386 Packages [3,264 B]                                          
Get:79 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/multiverse amd64 Packages [7,588 B]                                         
Get:80 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/multiverse Translation-en [2,836 B]                                         
Get:81 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/multiverse amd64 DEP-11 Metadata [2,468 B]                                  
Get:82 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/multiverse DEP-11 48x48 Icons [29 B]                                        
Get:83 http://ir.archive.ubuntu.com/ubuntu bionic-proposed/multiverse DEP-11 64x64 Icons [2,638 B]                                     
Get:84 http://ir.archive.ubuntu.com/ubuntu bionic-backports/main Sources [2,532 B]                                                     
Get:85 http://ir.archive.ubuntu.com/ubuntu bionic-backports/universe Sources [2,496 B]                                                 
Fetched 18.0 MB in 1min 11s (253 kB/s)                                                                                                 
Reading package lists... Done
E: Failed to fetch http://ir.archive.ubuntu.com/ubuntu/dists/bionic-updates/main/binary-i386/by-hash/SHA256/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  Hash Sum mismatch
   Hashes of expected file:
    - Filesize:650672 [weak]
    - SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    - SHA1:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [weak]
    - MD5Sum:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [weak]
   Hashes of received file:
    - SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    - SHA1:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [weak]
    - MD5Sum:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [weak]
    - Filesize:650672 [weak]
   Last modification reported: Sat, 07 Mar 2020 12:57:17 +0000
   Release file created at: Sat, 07 Mar 2020 14:34:50 +0000
E: Failed to fetch http://ir.archive.ubuntu.com/ubuntu/dists/bionic-updates/main/binary-amd64/by-hash/SHA256/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
E: Some index files failed to download. They have been ignored, or old ones used instead.

/etc/apt/sources.list

###### Ubuntu Main Repos
deb http://ir.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse 
deb-src http://ir.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse 

###### Ubuntu Update Repos
deb http://ir.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse 
deb http://ir.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse 
deb http://ir.archive.ubuntu.com/ubuntu/ bionic-proposed main restricted universe multiverse 
deb http://ir.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse 
deb-src http://ir.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse 
deb-src http://ir.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse 
deb-src http://ir.archive.ubuntu.com/ubuntu/ bionic-proposed main restricted universe multiverse 
deb-src http://ir.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse 

我不知道为什么会发生这种情况以及解决方案是什么。

提前致谢。

答案1

这被报告为一个错误这里对我有帮助的解决方案是

或按照以下步骤操作:

  1. sudo rm -rf /var/lib/apt/lists/*
  2. sudo apt-get update -o Acquire::CompressionTypes::Order::=gz
  3. sudo apt-get 更新 && sudo apt-get 升级

希望它对遇到同样问题的人有用。

答案2

每个存储库都包含一个 Release 文件,客户端在执行 apt 命令时会查找该文件。Release 文件包含有关可用 dist 和组件(例如 bionic main universe 等)的信息。它指定每个组件的位置和哈希值。获取相关 dist 后,客户端会搜索软件包列表,其中包含每个可用的 debian、其位置、全名、版本、哈希值、大小等。这就是您如何区分不同存储库中的软件包的方法。

如果这是官方存储库,而不是您或您的组织管理的本地存储库,那么您对此特定存储库无能为力。管理员必须纠正此问题,因为这是服务器端问题。

如果您需要一个包或更新并且不想等待 - 您可能需要通过运行相关的 apt 命令来更改或添加其他地区的存储库:add-apt-repository deb http://repo.tld/ubuntu distro component

您还可以/etc/apt/sources.list通过添加存储库路径,手动编辑您寻找的存储库源列表:deb http://repo.tld/ubuntu distro component

另外:如果您使用桌面操作系统,您也可以使用软件中心。

答案3

我在 docker build 中遇到了类似的问题。当我删除它可能缓存的镜像时,问题就消失了,所以

  docker image rm <your/image> 

然后尝试再次构建

相关内容