title: "无法运行apt-key命令检查数字签名 _ Couldn't execute _usr_bin_apt-key to check"
date: 2020-05-10
tags: ["raspiberry","linux","debian"]
categories: ["raspiberry","linux","debian"]
某日随便敲apt-get命令发现如下错误
获取:1 http://mirror.tuna.tsinghua.edu.cn/raspbian/raspbian buster InRelease [15.0 kB]
错误:1 http://mirror.tuna.tsinghua.edu.cn/raspbian/raspbian buster InRelease
Couldn't execute /usr/bin/apt-key to check /var/lib/apt/lists/partial/mirror.tuna.tsinghua.edu.cn_raspbian_raspbian_dists_buster_InRelease
获取:2 http://mirror.tuna.tsinghua.edu.cn/raspberrypi buster InRelease [25.2 kB]
错误:2 http://mirror.tuna.tsinghua.edu.cn/raspberrypi buster InRelease
Couldn't execute /usr/bin/apt-key to check /var/lib/apt/lists/partial/mirror.tuna.tsinghua.edu.cn_raspberrypi_dists_buster_InRelease
正在读取软件包列表... 完成
W: GPG 错误:http://mirror.tuna.tsinghua.edu.cn/raspbian/raspbian buster InRelease: Couldn't execute /usr/bin/apt-key to check /var/lib/apt/lists/partial/mirror.tuna.tsinghua.edu.cn_raspbian_raspbian_dists_buster_InRelease
E: 仓库 “http://mirror.tuna.tsinghua.edu.cn/raspbian/raspbian buster InRelease” 没有数字签名。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
W: GPG 错误:http://mirror.tuna.tsinghua.edu.cn/raspberrypi buster InRelease: Couldn't execute /usr/bin/apt-key to check /var/lib/apt/lists/partial/mirror.tuna.tsinghua.edu.cn_raspberrypi_dists_buster_InRelease
E: 仓库 “http://mirror.tuna.tsinghua.edu.cn/raspberrypi buster InRelease” 没有数字签名。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
百度各种方法无果后 误打误撞自己搞定了
解决办法-重装apt
apt -v #查看一下你的apt版本
cd /home #手动下载apt到你的设备中
wget http://ftp.cn.debian.org/debian/pool/main/a/apt/apt_1.8.2_armhf.deb
dpkg -i apt_1.8.2_armhf.deb
等待安装完成就ok了
[root@Raspi /home 13:33:57]$dpkg -i apt_1.8.2_armhf.deb
(正在读取数据库 ... 系统当前共安装有 99486 个文件和目录。)
准备解压 apt_1.8.2_armhf.deb ...
正在解压 apt (1.8.2) 并覆盖 (1.8.2) ...
正在设置 apt (1.8.2) ...
正在处理用于 libc-bin (2.28-10+rpi1) 的触发器 ...
正在处理用于 man-db (2.8.5-2) 的触发器 ...
[root@Raspi /home 13:34:13]$apt-get update
获取:1 http://mirror.tuna.tsinghua.edu.cn/raspbian/raspbian buster InRelease [15.0 kB]
获取:2 http://mirror.tuna.tsinghua.edu.cn/raspberrypi buster InRelease [25.2 kB]
获取:3 http://mirror.tuna.tsinghua.edu.cn/raspbian/raspbian buster/main Sources [11.4 MB]
获取:4 http://mirror.tuna.tsinghua.edu.cn/raspbian/raspbian buster/rpi Sources [1,132 B]
获取:5 http://mirror.tuna.tsinghua.edu.cn/raspbian/raspbian buster/contrib Sources [78.5 kB]
获取:6 http://mirror.tuna.tsinghua.edu.cn/raspbian/raspbian buster/non-free Sources [139 kB]
获取:7 http://mirror.tuna.tsinghua.edu.cn/raspbian/raspbian buster/main armhf Packages [13.0 MB]
获取:8 http://mirror.tuna.tsinghua.edu.cn/raspbian/raspbian buster/contrib armhf Packages [58.7 kB]
获取:9 http://mirror.tuna.tsinghua.edu.cn/raspbian/raspbian buster/non-free armhf Packages [103 kB]
获取:10 http://mirror.tuna.tsinghua.edu.cn/raspbian/raspbian buster/rpi armhf Packages [1,360 B]
获取:11 http://mirror.tuna.tsinghua.edu.cn/raspberrypi buster/main armhf Packages [327 kB]
已下载 25.1 MB,耗时 10秒 (2,421 kB/s)
正在读取软件包列表... 完成
以后有坏的东西自己下载重新安装就OK了
Q.E.D.