centos 升级curl版本

前言,阿里云漏洞报错显示
软件: curl 7.29.0-46.el7
命中: curl version less than 0:7.29.0-51.el7
解决方案:请直接在漏洞处理页面,选择对应服务器和漏洞,生成修复命令后,登录到服务器上运行即可。

curl的官网: http://www.city-fan.org/

1、安装repo

rpm -Uvh  http://www.city-fan.org/ftp/contrib/yum-repo/rhel6/x86_64/city-fan.org-release-2-1.rhel6.noarch.rpm

2、查看该 repo 包含的 curl 版本

yum.repos.d]# yum --showduplicates list curl --disablerepo="*" --enablerepo="city*"

Loaded plugins: fastestmirror
city-fan.org | 3.0 kB 00:00:00 
city-fan.org-debuginfo | 3.0 kB 00:00:00 
city-fan.org-source | 3.0 kB 00:00:00 
(1/3): city-fan.org-debuginfo/7/primary_db | 39 kB 00:00:02 
(2/3): city-fan.org-source/7/primary_db | 344 kB 00:00:03 
(3/3): city-fan.org/7/primary_db | 489 kB 00:00:03 
Loading mirror speeds from cached hostfile
* city-fan.org: nervion.us.es
* city-fan.org-debuginfo: www.city-fan.org
* city-fan.org-source: nervion.us.es
Installed Packages
curl.x86_64 7.29.0-42.el7 @anaconda 
Available Packages
curl.x86_64 7.62.0-1.0.cf.rhel7 city-fan.org

3、修改该repo的enable为1

vi /etc/yum.repos.d/city-fan.org.repo

[city-fan.org]

name=city-fan.org repository for Red Hat Enterprise Linux (and clones) $releasever ($basearch)

#baseurl=http://mirror.city-fan.org/ftp/contrib/yum-repo/rhel$releasever/$basearch

mirrorlist=http://mirror.city-fan.org/ftp/contrib/yum-repo/mirrorlist-rhel$releasever

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-city-fan.org

4、安装最新的curl

yum install curl

5、如果提示缺少依赖 libnghttp2.so.14()(64bit)

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/Packages/l/libnghttp2-1.6.0-1.el6.1.x86_64.rpm

然后重复第4步即可

6、查看curl版本

# curl -V
curl 7.62.0 (x86_64-redhat-linux-gnu) libcurl/7.62.0 NSS/3.36 zlib/1.2.7 libpsl/0.7.0 (+libicu/50.1.2) libssh2/1.8.0 nghttp2/1.31.1
Release-Date: 2018-10-31
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy PSL Metalink 

参考原文:http://www.cnblogs.com/kingsonfu/p/10069755.html

posted @ 2018-12-07 13:37  琼兔  阅读(6457)  评论(0编辑  收藏  举报