centos7 upgrade curl version

curl's official website:  http://www.city-fan.org/

1. Install the repo

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

3. Modify the repo's enable to 1

 

vim /etc/yum.repos.d/city-fan-for-curl.repo
[CityFanforCurl]
name=City Fan Repo
baseurl=http://www.city-fan.org/ftp/contrib/yum-repo/rhel7/x86_64/
enabled=0
gpgcheck=0

4. Install the latest curl

yum update curl --enablerepo=CityFanforCurl -y

5. If the prompt lacks dependency on 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. View the curl version

# 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 

Or source code installation

Download the source code of 7.63

wget http://curl.haxx.se/download/curl-7.69.1.tar.gz

Unzip

tar -xvf curl-7.69.1.tar.gz
cd curl.7.69.1


Specify the installation directory

./configure --prefix=/usr/local/curl

Compile and install
sudo make
sudo make install
 
Add command environment variable
export PATH = $ PATH: / usr / local / curl / bin
 
Header file used by C or C ++ call
# include <curl / curl.h>
 
 
Copy the header file to the system directory, You can also add
sudo cp -R / usr / local / curl / include / curl / usr / include

Published 59 original articles · 21 praises · 20,000+ views

Guess you like

Origin blog.csdn.net/tony_vip/article/details/105202578