从本地存储库升级Ubuntu 18.04 LTS软件包时出错

时间:2019-05-30 07:18:30

标签: upgrade ubuntu-18.04 apt-get apt

我正在维护Ubuntu 18.04 LTS的本地存储库,最近使用apt-mirror更新了该存储库。我尝试使用以下命令升级软件包

sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade

前两个命令正常运行,没有任何错误。但是,sudo apt-get upgrade导致以下错误

Get:645 http://192.168.1.1/ubuntuRepo bionic-updates/multiverse amd64 virtualbox-guest-additions-iso all 5.2.18-1~ubuntu18.04.1 [39.0 MB]                                     
Err:645 http://192.168.1.1/ubuntuRepo bionic-updates/multiverse amd64 virtualbox-guest-additions-iso all 5.2.18-1~ubuntu18.04.1                                               
  File has unexpected size (38955904 != 39016736). Mirror sync in progress? [IP: 192.168.1.1 80]
  Hashes of expected file:
   - SHA256:f7c5ab5ea5b1feadc2cf5d8527d7c14c8b34439d5345fd04822f12381681b2a6
   - SHA1:5e0d43ebddd08d6256ac809c746de9c483ea83f1 [weak]
   - MD5Sum:b2e992fd6462e216bc651ddb020216b8 [weak]
   - Filesize:39016736 [weak]
Get:646 http://192.168.1.1/ubuntuRepo bionic-updates/main amd64 xbrlapi amd64 5.5-4ubuntu2.0.1 [61.9 kB]                                                                      
Fetched 763 MB in 1min 7s (11.4 MB/s)                                                                                                                                             
E: Failed to fetch http://192.168.1.1/ubuntuRepo/pool/multiverse/v/virtualbox-guest-additions-iso/virtualbox-guest-additions-iso_5.2.18-1~ubuntu18.04.1_all.deb  File has unexpected size (38955904 != 39016736). Mirror sync in progress? [IP: 192.168.1.1 80]
   Hashes of expected file:
    - SHA256:f7c5ab5ea5b1feadc2cf5d8527d7c14c8b34439d5345fd04822f12381681b2a6
    - SHA1:5e0d43ebddd08d6256ac809c746de9c483ea83f1 [weak]
    - MD5Sum:b2e992fd6462e216bc651ddb020216b8 [weak]
    - Filesize:39016736 [weak]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

如何解决?

我的/etc/apt/sources.list的内容如下。

deb [arch=amd64] http://192.168.1.1/ubuntuRepo bionic main restricted universe multiverse
deb [arch=amd64] http://192.168.1.1/ubuntuRepo bionic-security main restricted universe multiverse
deb [arch=amd64] http://192.168.1.1/ubuntuRepo bionic-updates main restricted universe multiverse
deb [arch=amd64] http://192.168.1.1/ubuntuRepo bionic-proposed main restricted universe multiverse
deb [arch=amd64] http://192.168.1.1/ubuntuRepo bionic-backports main restricted universe multiverse

1 个答案:

答案 0 :(得分:0)

该问题已解决,方法是清除/ var / lib / apt /中的文件,然后在装有本地存储库的计算机中运行sudo apt-mirror。

相关问题