wsl下qemu的apt源问题

Posted by 婷 on October 3, 2023 本文总阅读量

问题

qemu模拟的是arm64debian系统,在apt update的时候,总会报错,导致我想下个tcpdump也没有找到包

image-20231003164734532

Get:1 http://mirrors.ustc.edu.cn/debian unstable InRelease [195 kB]
Err:1 http://mirrors.ustc.edu.cn/debian unstable InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
Reading package lists... Done
W: GPG error: http://mirrors.ustc.edu.cn/debian unstable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
E: The repository 'http://mirrors.ustc.edu.cn/debian unstable InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

debian的版本

image-20231003163929077

我的qemu中的/etc/apt/sources.list文件内容如下

deb http://mirrors.ustc.edu.cn/debian/ unstable main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian/ unstable main non-free contrib

解决方法

前面的报错提示信息中有两个key,分别是6ED0E7B82643E1310E98404D386FA1D9

image-20231003165103348

输入这两条命令,然后重新update即可

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6ED0E7B82643E131
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9

image-20231003165900948