如何修复Ubuntu中包缓存文件被毁问题

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

我在终端运行的命令以及输出:html

$ sudo apt update

示例输出:linux

Hit:1 http://it-mirrors.evowise.com/ubuntu bionic InRelease
Hit:2 http://it-mirrors.evowise.com/ubuntu bionic-updates InRelease
Hit:3 http://it-mirrors.evowise.com/ubuntu bionic-backports InRelease
Hit:4 http://it-mirrors.evowise.com/ubuntu bionic-security InRelease
Hit:5 http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu bionic InRelease
Hit:7 http://ppa.launchpad.net/leaeasy/dde/ubuntu bionic InRelease
Hit:8 http://ppa.launchpad.net/rvm/smplayer/ubuntu bionic InRelease
Ign:6 https://dl.bintray.com/etcher/debian stable InRelease
Get: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... Done
E: The package cache file is corrupted, it has the wrong hash

如何修复Ubuntu中包缓存文件被毁问题如何修复Ubuntu中包缓存文件被毁问题

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

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

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

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

如今我再次使用下面的命令更新系统:ionic

如何修复Ubuntu中包缓存文件被毁问题如何修复Ubuntu中包缓存文件被毁问题

如今好了!但愿它有帮助。.net

资源htm

via: https://www.ostechnix.com/fix-e-the-package-cache-file-is-corrupted-it-has-the-wrong-hash-error-in-ubuntu/blog

做者:sk 选题:lujun9972 译者:geekpi 校对:wxy资源

本文由 LCTT 原创编译,Linux中国 荣誉推出

本文地址:https://www.linuxprobe.com/fix-package-file-corrupted.html

相关文章
相关标签/搜索