欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 文旅 > 明星 > linux安装git

linux安装git

2025/5/20 10:51:36 来源:https://blog.csdn.net/iummature/article/details/148065534  浏览:    关键词:linux安装git
[root@MiWiFi-RC06-srv rpm-gpg]# yum install git
已加载插件:fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* epel: d2lzkl7pfhq30w.cloudfront.net* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 git.x86_64.0.2.43.0-1.ep7 将被 安装
--> 正在处理依赖关系 git-core = 2.43.0-1.ep7,它被软件包 git-2.43.0-1.ep7.x86_64 需要
--> 正在处理依赖关系 git-core-doc = 2.43.0-1.ep7,它被软件包 git-2.43.0-1.ep7.x86_64 需要
--> 正在处理依赖关系 perl-Git = 2.43.0-1.ep7,它被软件包 git-2.43.0-1.ep7.x86_64 需要
--> 正在处理依赖关系 perl(Term::ReadKey),它被软件包 git-2.43.0-1.ep7.x86_64 需要
--> 正在处理依赖关系 perl(Git),它被软件包 git-2.43.0-1.ep7.x86_64 需要
--> 正在检查事务
---> 软件包 git-core.x86_64.0.2.43.0-1.ep7 将被 安装
--> 正在处理依赖关系 libpcre2-8.so.0()(64bit),它被软件包 git-core-2.43.0-1.ep7.x86_64 需要
---> 软件包 git-core-doc.noarch.0.2.43.0-1.ep7 将被 安装
---> 软件包 perl-Git.noarch.0.2.43.0-1.ep7 将被 安装
--> 正在处理依赖关系 perl(Error),它被软件包 perl-Git-2.43.0-1.ep7.noarch 需要
---> 软件包 perl-TermReadKey.x86_64.0.2.30-20.el7 将被 安装
--> 正在检查事务
---> 软件包 pcre2.x86_64.0.10.23-2.el7 将被 安装
---> 软件包 perl-Error.noarch.1.0.17020-2.el7 将被 安装
--> 解决依赖关系完成依赖关系解决===================================================================================================================================================================================Package                                        架构                                 版本                                             源                                      大小
===================================================================================================================================================================================
正在安装:git                                            x86_64                               2.43.0-1.ep7                                     endpoint                                54 k
为依赖而安装:git-core                                       x86_64                               2.43.0-1.ep7                                     endpoint                                11 Mgit-core-doc                                   noarch                               2.43.0-1.ep7                                     endpoint                               3.0 Mpcre2                                          x86_64                               10.23-2.el7                                      base                                   201 kperl-Error                                     noarch                               1:0.17020-2.el7                                  base                                    32 kperl-Git                                       noarch                               2.43.0-1.ep7                                     endpoint                                41 kperl-TermReadKey                               x86_64                               2.30-20.el7                                      base                                    31 k事务概要
===================================================================================================================================================================================
安装  1 软件包 (+6 依赖软件包)总计:14 M
安装大小:46 M
Is this ok [y/d/N]: y
Downloading packages:
警告:/var/cache/yum/x86_64/7/endpoint/packages/perl-Git-2.43.0-1.ep7.noarch.rpm: 头V4 RSA/SHA1 Signature, 密钥 ID 703df089: NOKEY
从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-endpoint-7 检索密钥获取 GPG 密钥失败:[Errno 14] curl#37 - "Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-endpoint-7"

报错

Downloading packages:
警告:/var/cache/yum/x86_64/7/endpoint/packages/perl-Git-2.43.0-1.ep7.noarch.rpm: 头V4 RSA/SHA1 Signature, 密钥 ID 703df089: NOKEY
从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-endpoint-7 检索密钥


获取 GPG 密钥失败:[Errno 14] curl#37 - "Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-endpoint-7"

解决方法:

方法一:关闭 GPG 校验(不推荐,仅用于测试或临时解决)

sudo yum install perl-Git --nogpgcheck

不推荐用于生产环境,因为关闭 GPG 校验会有安全风险。


方法二:手动导入 GPG 公钥(推荐)
  1. 获取对应的 GPG 公钥

    如果你使用的是某个特定的 CentOS/RHEL/Endpoint 镜像或私有源,请向维护者或官网查找 RPM-GPG-KEY-endpoint-7

  2. 下载并导入密钥

    假设你找到公钥文件,比如:

    wget http://your.repo.domain/path/to/RPM-GPG-KEY-endpoint-7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-endpoint-7

    然后导入它:

    sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-endpoint-7

  3. 再次执行安装命令

    sudo yum install perl-Git

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词