在Linux操作系統中,安裝軟件依賴包時,出現了尚未安裝任何 GPG 公鑰,要求使用rpm --import public.gpg.key導入
問題:
[root@server7 yum.repos.d]# yum -y install bind-chroot bind
已加載插件:langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
您已啟用軟件包 GPG 簽名檢查,這樣很好。不過您尚未安裝任何 GPG 公鑰。請下載您希望安裝的軟件簽名公鑰並安裝。假設公鑰已下載,安裝命令是:
rpm --import public.gpg.key
或者,在軟件源配置中,使用 'gpgkey' 選項指定軟件源使用的公鑰 URL,這樣 yum 會自動安裝它。
詳情請聯系發行版或軟件包制作人。
問題源:rhel7
解決辦法:一般情況下GPG KEY,在系統都會有的,在你的linux安裝光盤目錄下,或者在/etc/pki/rpm-gpg/目錄下,比如我的系統在/etc/pki/rpm-gpg/目錄下,就存在一個RPM-GPG-KEY-CentOS-7
[root@server7 yum.repos.d]# cd /etc/pki/rpm-gpg/
[root@server7 rpm-gpg]# ls
RPM-GPG-KEY-redhat-beta RPM-GPG-KEY-redhat-legacy-rhx
RPM-GPG-KEY-redhat-legacy-former RPM-GPG-KEY-redhat-release
RPM-GPG-KEY-redhat-legacy-release
[root@server7 rpm-gpg]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
即可解決