天天看點

ubuntu 恢複apt_修複 Ubuntu 中 “E: The package cache file is corrupted” | Linux 中國

ubuntu 恢複apt_修複 Ubuntu 中 “E: The package cache file is corrupted” | Linux 中國

今天,我嘗試更新我的 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 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 恢複apt_修複 Ubuntu 中 “E: The package cache file is corrupted” | Linux 中國

Ubuntu 中的 “The package cache file is corrupted, it has the wrong hash” 錯誤

經過一番谷歌搜尋,我找到了解決此錯誤的方法。

如果你遇到過這個錯誤,不要驚慌。隻需運作下面的指令修複。

在運作指令之前,請再次确認你在最後加入了 

*

。在指令最後加上 

*

 很重要。如果你沒有添加,它會删除 

/var/lib/apt/lists/

*目錄,而且無法恢複。我提醒過你了!

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

現在我再次使用下面的指令更新系統:

$ sudo apt update

ubuntu 恢複apt_修複 Ubuntu 中 “E: The package cache file is corrupted” | Linux 中國

現在好了!希望它有幫助。

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

作者:sk 選題:lujun9972 譯者:geekpi 校對:wxy

本文由 LCTT 原創編譯,Linux中國 榮譽推出

ubuntu 恢複apt_修複 Ubuntu 中 “E: The package cache file is corrupted” | Linux 中國

?:還 在看嗎?