redhat7.2 error: public.gpg.key: import read failed(2).

系統版本:

[root@mu01 yum.repos.d]# cat /etc/redhat-release 

Red Hat Enterprise Linux Server release 7.2 (Maipo)

最初本地yum文件:

[root@mu01 yum.repos.d]# cat local.repo 

[loacl]

name=local

baseurl=file:///media/cdrom

enabled=1

gpgchek=0

之後本地yum源安裝軟件,出現以下報錯:

[root@mu01 yum.repos.d]# yum install elinks*

Loaded plugins: langpacks, product-id, search-disabled-repos


You have enabled checking of packages via GPG keys. This is a good thing. 

However, you do not have any GPG public keys installed. You need to download

the keys for packages you wish to install and install them.

You can do that by running the command:

    rpm --import public.gpg.key



Alternatively you can specify the url to the key you would like to use

for a repository in the 'gpgkey' option in a repository section and yum 

will install it for you.


For more information contact your distribution or package provider.


Problem repository: loacl

之後輸入提示命令出現如下報錯:

[root@mu01 yum.repos.d]# rpm --import public.gpg.key

error: public.gpg.key: import read failed(2).

將gpgkey路徑加入到編輯local.repo文件:

[root@mu01 yum.repos.d]# cat local.repo 

[loacl]

name=local

baseurl=file:///media/cdrom

enabled=1

gpgchek=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

執行yum list之後安裝成功:

[root@mu01 yum.repos.d]# yum install elinks*

Loaded plugins: langpacks, product-id, search-disabled-repos

loacl                                                                                                                                                                 | 4.1 kB  00:00:00     

Resolving Dependencies

--> Running transaction check

---> Package elinks.x86_64 0:0.12-0.36.pre6.el7 will be installed

--> Processing Dependency: libmozjs185.so.1.0()(64bit) for package: elinks-0.12-0.36.pre6.el7.x86_64

--> Processing Dependency: libnss_compat_ossl.so.0()(64bit) for package: elinks-0.12-0.36.pre6.el7.x86_64

--> Running transaction check

---> Package js.x86_64 1:1.8.5-19.el7 will be installed

---> Package nss_compat_ossl.x86_64 0:0.9.6-8.el7 will be installed

--> Finished Dependency Resolution


Dependencies Resolved


………………………………

方法百度所得,參考鏈接:http://www.bubuko.com/infodetail-1639901.html


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章