在Debian12(Bookworm)运行
apt-get update
报错,提示如下
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repo.mysql.com/apt/debian bookworm InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C
W: Failed to fetch http://repo.mysql.com/apt/debian/dists/bookworm/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C
W: Some index files failed to download. They have been ignored, or old ones used instead.
在Baidu、Reddit和Github上找到了讨论同样情况的帖子和issue,但是并没有人给出解决问题的正确办法(有人建议将B7B3B788A8D3785C添加到系统apt的key库中,然而并没有什么用处)
经尝试,正确办法如下
到MySQL下载社区版本的deb安装包(config_all.deb)https://dev.mysql.com/downloads/repo/apt/(直接下载就大错特错了,仅仅是一个html,还需要点download)
wget https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb
用dpkg安装
dpkg -i mysql-apt-config_0.8.29-1_all.deb
会弹出一个configuration界面,无需修改,直接移动到OK行回车即可
再次运行
apt-get update && apt-get dist-upgrade
即可验证恢复正常