[真正能用]CentOS 7.x升级安装 git 2.x出错的非源码编译解决方案

在CentOS7.x上尝试通过编译方式安装git2.x时遇到链接错误,提示缺少libcom_err.so.3和libssl.so.10。为解决此问题,可以尝试使用第三方源如IUS仓库。首先运行`curl https://setup.ius.io | sh`安装IUS,然后用`yum remove -y git && yum -y install git222`来移除旧版git并安装git222。成功安装后,通过`git --version`验证,显示git版本为2.22.5,问题得到解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

CentOS 7.x安装 git 2.x 时,使用编译的方法报错

/usr/bin/ld: warning: libcom_err.so.3, needed by /data01/liuyi/anaconda3/lib/libcurl.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libssl.so.10, needed by //usr/lib64/libssh2.so.1, may conflict with libssl.so.1.1
/usr/bin/ld: imap-send.o: undefined reference to symbol ‘SSL_library_init@@libssl.so.10’
//usr/lib64/libssl.so.10: error adding symbols: DSO missing from command line
collect2: 错误:ld 返回 1
make: *** [git-imap-send] 错误 1

采用第三方源:

curl https://setup.ius.io | sh
yum search git 

此时会搜索到很多信息,选择看起来像的那个
比如:
在这里插入图片描述
这个222看起来很像

所以

yum remove -y git | yum -y install git222

验证:

git --version

git version 2.22.5

完毕!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值