ubuntu 恢复apt_修复 Ubuntu 中“E: The package cache file is corrupted”

19f048ff192b1ecb31511fd3445c5220.png

今天,我尝试更新我的 Ubuntu 18.04 LTS 的仓库列表,但收到了一条错误消息:“E: The package cache file is corrupted, it has the wrong hash”。

-- Sk(作者)

今天,我尝试更新我的 Ubuntu 18.04 LTS 的仓库列表,但收到了一条错误消息:“E: The package cache file is corrupted, it has the wrong hash”。这是我在终端运行的命令以及输出:

$ sudo apt update

示例输出:

Hit:1 http://it-mirrors.evowise.com/ubuntu bionic InReleaseHit:2 http://it-mirrors.evowise.com/ubuntu bionic-updates InReleaseHit:3 http://it-mirrors.evowise.com/ubuntu bionic-backports InReleaseHit:4 http://it-mirrors.evowise.com/ubuntu bionic-security InReleaseHit:5 http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu bionic InReleaseHit:7 http://ppa.launchpad.net/leaeasy/dde/ubuntu bionic InReleaseHit:8 http://ppa.launchpad.net/rvm/smplayer/ubuntu bionic InReleaseIgn:6 https://dl.bintray.com/etcher/debian stable InReleaseGet:9 https://dl.bintray.com/etcher/debian stable Release [3,674 B]Fetched 3,674 B in 3s (1,196 B/s)Reading package lists... DoneE: The package cache file is corrupted, it has the wrong hash
4d63f7699a9899f9d8bae34f1b9f05a7.png

经过一番谷歌搜索,我找到了解决此错误的方法。

如果你遇到过这个错误,不要惊慌。只需运行下面的命令修复。

在运行命令之前,请再次确认你在最后加入了 *。在命令最后加上 * 很重要。如果你没有添加,它会删除 /var/lib/apt/lists/*目录,而且无法恢复。我提醒过你了!

$ sudo rm -rf /var/lib/apt/lists/*

现在我再次使用下面的命令更新系统:

$ sudo apt update
d74663d506ef3f319da0056cd60fce44.png

现在好了!希望它有帮助。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值