如何去除rpm的公钥

| No Comments
一不小心导入了同名称但是不同内容的公钥,然后在再次导入正确的公钥的时候,发现已经导入不了,提示内容如下:
[cnangel@localhost cnangel]$sudo rpm --import RPM-GPG-KEY-cnangel
error: RPM-GPG-KEY-cnangel: import failed.
而查看rpm的选项没有delete相关操作;重新import并使用--force选项,则提示:
rpm: only installation, upgrading, rmsource and rmspec may be forced
查看路径/etc/pki/rpm-gpg/下面也没有刚才错误的导入公钥文件,该如何删除错误的公钥而导入正确的公钥呢?
经过查看rpm和gpg相关文档,可以用如下方案解决:
[cnangel@localhost ~]$rpm -q gpg-pubkey
gpg-pubkey-57bbccba-4a6f97af
gpg-pubkey-16ca1a56-4a100959
gpg-pubkey-a3a882c1-4a1009ef
原来,经过查询获得gpg-pubkey的公钥就是这些结果,不过无法显示是哪个文件导入的,不过还是有版本,这个查询接口的排序是时间先后顺序,所以可以推算刚才导入错误的文件是第几个,然后删除即可:
[cnangel@localhost ~]$sudo rpm -e --allmatches gpg-pubkey-16ca1a56-4a100959
接着,可以导入正确的公钥了 :)

Leave a comment

Archives

Pages

Powered by Movable Type 5.2.2

December 2012

Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          

Recent Assets

  • dish_st4.png
  • dish_m5.png
  • dish_3.png
  • dish_two.png
  • dish_6.png
  • dish_1.png.png
  • 照片1028 105.jpg
  • 照片1028 088.jpg
  • 照片1028 084.jpg
  • 照片1028 081.jpg
Creative Commons License
This blog is licensed under a Creative Commons License.

About this Entry

This page contains a single entry by Cnangel published on June 4, 2010 10:09 PM.

fedora13的发布 was the previous entry in this blog.

一种特殊的一致性哈希算法的研究 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.