前言
自使用一段时间树莓派后,忽然发现无法正常使用apt-get update
更新,并提示由于没有公钥,无法验证下列签名
,这个问题是因为目前没有公钥,所有无法使用,因此需要对树莓派的软件源进行修改。
修复
注意:以下命令需在root
权限下进行
备份原软件源
cp /etc/apt/sources.list /etc/apt/sources.list.backup2 cp /etc/apt/sources.list.d/raspi.list /etc/apt/sources.list.d/raspi.list.backup2
- 通过nano编辑sources.list文件
sudo nano /etc/apt/sources.list
删除原来所有项,并添加如下:
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free
- 删除或注释raspi.list
rm -rf /etc/apt/sources.list.d/raspi.list
评论 (0)