apt-get update 警告Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg)

apt-get update出现问题 image

找到警告相关源的key

apt-key list

列出所有 keyring 的信息, 然后找出该 keyring 的 fingerprint
image

接下来导出相应key到指定目录

导出命令中只需要fingerprint的末尾 8 位
像是这样

sudo apt-get export 437D05B5 | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/f0.gpg

sudo apt-key export 437D05B5 | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/f1.gpg

sudo apt-key export C0B21F32 | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/f2.gpg

image

修改后
image

修改指定加载key的路径

修改: etc/apt/sources.list.d/***.list
修改后:
image

再次 sudo apt update, 无警告

参考:
https://www.jianshu.com/p/a239a9f969fe
https://xieshaohu.wordpress.com/category/linux/ubuntu/
https://blog.csdn.net/weixin_40599145/article/details/127627480

posted @ 2023-01-04 02:55  泥烟  阅读(845)  评论(0编辑  收藏  举报