1. 程式人生 > >centos 升級curl版本

centos 升級curl版本

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.61.1 (x86_64-redhat-linux-gnu) libcurl/7.61.1 OpenSSL/1.0.1e zlib/1.2.3 c-ares/1.14.0 libssh2/1.8.0 nghttp2/1.6.0

Release-Date: 2018-09-05

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 Metalink