zoukankan      html  css  js  c++  java
  • 本地yum源无法使用 ,rpm --import public.gpg.key

    一次重装CentOS7系统后,挂载光驱并制作成本地yum源却无法使用yum进行安装,这TM着实有点闹心。o(>﹏<)o

    案发现场:

    [root@crntos7-server ~]# yum -y install /mnt/Packages/vsftpd-3.0.2-22.el7.x86_64.rpm

    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.

    解决方法:

    [root@crntos7-server ~]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
    [root@crntos7-server ~]# yum -y install /mnt/Packages/httpd-2.4.6-67.el7.centos.x86_64.rpm
    Examining /mnt/Packages/httpd-2.4.6-67.el7.centos.x86_64.rpm: httpd-2.4.6-67.el7.centos.x86_64
    Marking /mnt/Packages/httpd-2.4.6-67.el7.centos.x86_64.rpm to be installed
    Resolving Dependencies
    --> Running transaction check
    ---> Package httpd.x86_64 0:2.4.6-67.el7.centos will be installed
    --> Processing Dependency: httpd-tools = 2.4.6-67.el7.centos for package: httpd-2.4.6-67.el7.centos.x86_64
    --> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-67.el7.centos.x86_64
    --> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-67.el7.centos.x86_64
    --> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-67.el7.centos.x86_64
    --> Running transaction check
    ---> Package apr.x86_64 0:1.4.8-3.el7 will be installed
    ---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
    ---> Package httpd-tools.x86_64 0:2.4.6-67.el7.centos will be installed

    ............

    用 rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY  导入 一般情况下

    GPG KEY,一般系统都会有的,在你的linux安装光盘目录下,或者在/etc/pki/rpm-gpg/目录下有一个 PM-GPG-KEY-CentOS-7

    如果导入失败 那么 可已将GPG.KEY路径直接加入到你编辑的/etc/yum.repos.d/下的CentOS7.repo 保存退出

    然后 yum makecache  元数据缓存创建

    参考链接:https://www.cnblogs.com/goon2016vv/p/5625240.html

    刚入们的超级小白,学习过程当中记录一些异常信息及解决方法。 欢迎大家一起交流。
  • 相关阅读:
    c# base64及MD5工具类
    c# dateTime格式转换为Unix时间戳工具类
    c# 金钱大写转小写工具类
    c# bitmap的拷贝及一个图像工具类
    C# DataTable映射成Entity
    Kubernetes---Service(SVC)服务--ingress api
    Kubernetes---Service(SVC)服务
    为网站文字前面添加图标 在线调用 Font Awesome 字体icon小图标 美化网站
    [转]office 2016 4合1/3合1 专业版 增强版 精简绿色安装版
    [转]数据恢复 文件恢复工具 DiskGenius v4.9.1 绿色专业版及单文件
  • 原文地址:https://www.cnblogs.com/JiangDameiniu/p/9051658.html
Copyright © 2011-2022 走看看