debian apt命令
apt
command is used to install, update, remove packages in Linux distributions like Ubuntu, Debian, Mint, Kali. apt
is mainly used with the deb
packages. With the apt update
or apt-get update
command the repository information is downloaded to from the deb
repositories to the local repositories. Hash is used to checking if the downloaded file is valid. If there is a problem we may face with the Hash Sum mismatch
error.
apt
命令用于安装,更新,删除Linux发行版中的软件包,例如Ubuntu,Debian,Mint,Kali。 apt
主要与deb
软件包一起使用。 使用apt update
或apt-get update
命令可以将存储库信息从deb
存储库下载到本地存储库。 哈希用于检查下载的文件是否有效。 如果有问题,我们可能会遇到Hash Sum mismatch
错误。
“哈希总和不匹配”错误 (“Hash Sum mismatch” Error)
First, we will look at how the Hash Sum mismatch
error occurs during the apt update
or apt-get update
command usage.
首先,我们将了解在apt update
或apt-get update
命令使用过程中如何产生Hash Sum mismatch
错误。
$ apt update && apt dist-upgrade -y
We can see that following errors and warnings are printed during the update repository information.
我们可以看到在更新存储库信息期间打印了以下错误和警告。
- Last modification reported: Wed, 26 Jun 2019 12:03:10 +0000 上次修改的报告时间:2019年6月26日,星期三12:03:10 +0000
- Hashes of expected file: 预期文件的哈希值:
- – Filesize:17059946 [weak] –文件大小:17059946 [弱]
- Last modification reported: Wed, 26 Jun 2019 12:03:10 +0000 上次修改的报告时间:2019年6月26日,星期三12:03:10 +0000
- Release file created at: Wed, 26 Jun 2019 12:04:12 +0000 发布文件创建于:2019年6月26日,星期三12:04:12 +0000
- E: Some index files failed to download. They have been ignored, or old ones used instead. E:某些索引文件下载失败。 它们已被忽略,或改用旧的。
“哈希和不匹配”解决方案 (“Hash Sum mismatch” Solution)
In order to solve the Hash Sum mismatch
error, we need to remove downloaded repository information from the /var/lib/apt/lists/
directory. We will use rm -rf
command for this. We will also provide the sudo
command.
为了解决Hash Sum mismatch
错误,我们需要从/var/lib/apt/lists/
目录中删除下载的存储库信息。 我们将使用rm -rf
命令。 我们还将提供sudo
命令。
$ sudo rm -rf /var/lib/apt/lists/*
Then the update command like below will work.
然后,如下所示的update命令将起作用。
$ sudo apt update
翻译自: https://www.poftut.com/apt-command-hash-sum-mismatch-error-and-solution-on-ubuntu-debian-mint-kali/
debian apt命令