我将sources.list内容改乱了,然后拷贝了debian安装手册上的bullseye的内容到这里后,将里面的bullseye修改为了bookworm,运行update后,提示:由于没有公钥,无法验证下列签名。请教一下解决办法,多谢
sources.list内容如下:
Security updates
deb Index of /debian-security bookworm-security main contrib non-free non-free-firmware
deb-src Index of /debian-security bookworm-security main contrib non-free non-free-firmware
Debian mirror
Base repository
deb Index of /debian bookworm main contrib non-free non-free-firmware
deb-src Index of /debian bookworm main contrib non-free non-free-firmware
Stable updates
deb Index of /debian bookworm-updates main contrib non-free non-free-firmware
deb-src Index of /debian bookworm-updates main contrib non-free non-free-firmware
Stable backports
#deb Index of /debian bookworm-backports main contrib non-free non-free-firmware
#deb-src Index of /debian bookworm-backports main contrib non-free non-free-firmware
提示如下图:
尝试把安全更新的 域名 由security.debian.org
改成deb.debian.org
试试?
改了后还是一样的,提示:由于没有公钥,无法验证下列签名。
是不是什么公钥gpg文件被删掉了呢,这个能从哪里下载放到哪里呢?
应该是/etc/apt/trusted.gpg.d/
目录下的文件被删除了,运行
sudo apt reinstall debian-archive-keyring
重新安装试试。
ls查看了一下 /etc/apt/trusted.gpg.d/
目录下,是空的;
运行了一下 ```
sudo apt reinstall debian-archive-keyring
提示:不能重新安装 debian-archive-keyring,因为无法下载它。
从这里下载:http://http.us.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2023.3+deb12u1_all.deb
然后安装:
sudo dpkg -i ./xxx.deb
非常感谢,麻烦能再给看看,
执行了sudo dpkg后,
root@debian1250:/home/user-g1/下载# sudo dpkg -i ./debian-archive-keyring_2023.3+deb12u1_all.deb
(正在读取数据库 … 系统当前共安装有 209402 个文件和目录。)
准备解压 …/debian-archive-keyring_2023.3+deb12u1_all.deb …
正在解压 debian-archive-keyring (2023.3+deb12u1) 并覆盖 (2023.3+deb12u1) …
正在设置 debian-archive-keyring (2023.3+deb12u1) …
root@debian1250:/home/user-g1/下载# cd /etc/apt
root@debian1250:/etc/apt# ls
apt.conf.d keyrings listchanges.conf.d sources.list sources.list.d
auth.conf.d listchanges.conf preferences.d sources.list~ trusted.gpg.d
root@debian1250:/etc/apt# cd trusted.gpg.d
root@debian1250:/etc/apt/trusted.gpg.d# ls
root@debian1250:/etc/apt/trusted.gpg.d# cd …
root@debian1250:/etc/apt# cd keyrings
root@debian1250:/etc/apt/keyrings#ls
运行apt-get update,也提示没有公钥
我试了一下,和你一样,不知道为什么文件没有被安装进去。
不过你可以手动解压安装包(再解压里面的data.tar.xz
),然后把那个目录里的文件复制过去就行了。
非常感谢,成功更新了!
把解压后的/data/etc/apt/trusted.gpg.d目录下文件拷贝到了/etc/apt/trusted.gpg.d目录下后,更新成功了,非常感谢