系统版本:

[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