CentOS 6/7 update curl

2017- 04- 0810:17:24 Comment 532℃ heat

Due to business needs, the curl version on the server is too old and has loopholes, so I took some time to upgrade to the latest version to ensure the safety of communication between servers. Then I read some tutorials online and found that they are different. Finally, I found the easiest and most convenient one The method, share with everyone.

1. View current version##

The default curl version on Centos6.8 is 7.19.7, and the latest one is 7.53.1. This version is too old and too old..., hurry up and enter curl --version on the server to display the current version:

  1. curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.21 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
  2. Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp
  3. Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz

2. Upgrade curl

Use city-fan's update source to update here.

2.1. Update ca-bundle

  1. cp /etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/ca-bundle.crt.bak
  1. curl http://curl.haxx.se/ca/cacert.pem -o /etc/pki/tls/certs/ca-bundle.crt

2.2 Added repo source###

  1. vim /etc/yum.repos.d/city-fan-for-curl.repo

Centos6 is edited as follows:

  1. [ CityFanforCurl]
  2. name=City Fan Repo
  3. baseurl=http://www.city-fan.org/ftp/contrib/yum-repo/rhel6/x86_64/
  4. enabled=0
  5. gpgcheck=0

Centos7 is edited as follows:

  1. [ CityFanforCurl]
  2. name=City Fan Repo
  3. baseurl=http://www.city-fan.org/ftp/contrib/yum-repo/rhel7/x86_64/
  4. enabled=0
  5. gpgcheck=0

2.3 Update curl

Use the following command to update directly:

  1. yum update curl --enablerepo=CityFanforCurl -y

2.4 Restart service###

After the update is complete, it is recommended to restart. It can be used normally.

  1. lnmp php-fpm restart

Enter curl --version again at this time:

  1. curl 7.53.1 (x86_64-redhat-linux-gnu) libcurl/7.53.1 OpenSSL/1.0.1e zlib/1.2.3 c-ares/1.12.0 libssh2/1.8.0 nghttp2/1.6.0
  2. Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
  3. Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy Metalink

3. problem##

One server has no problem following this step, and the other one encounters a problem and reports an error, which is probably the mirror source error and the CA certificate problem:

  1. http://mirror.math.princeton.edu/pub/epel/6/x86_64/repodata/00b164f9525392a7a34d12e3367cc3bc53b9fd4ecd0614cd22ccacdb21eb1b2b-filelists.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
  2. Trying other mirror.
  3. http://mirrors.mit.edu/epel/6/x86_64/repodata/00b164f9525392a7a34d12e3367cc3bc53b9fd4ecd0614cd22ccacdb21eb1b2b-filelists.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
  4. Trying other mirror.
  5. http://mirror.metrocast.net/fedora/epel/6/x86_64/repodata/00b164f9525392a7a34d12e3367cc3bc53b9fd4ecd0614cd22ccacdb21eb1b2b-filelists.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
  6. Trying other mirror.
  7. http://mirror.mrjester.net/fedora/epel/6/x86_64/repodata/00b164f9525392a7a34d12e3367cc3bc53b9fd4ecd0614cd22ccacdb21eb1b2b-filelists.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
  8. Trying other mirror.
  9. http://fedora-epel.mirror.lstn.net/6/x86_64/repodata/00b164f9525392a7a34d12e3367cc3bc53b9fd4ecd0614cd22ccacdb21eb1b2b-filelists.sqlite.bz2: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
  10. Trying other mirror.
  11. https://dl.fedoraproject.org/pub/epel/6/x86_64/repodata/00b164f9525392a7a34d12e3367cc3bc53b9fd4ecd0614cd22ccacdb21eb1b2b-filelists.sqlite.bz2: [Errno 14] PYCURL ERROR 77 - "Problem with the SSL CA cert (path? access rights?)"

So execute the command, and then continue to execute from 2.3.

  1. cp /etc/pki/tls/certs/ca-bundle.crt.bak /etc/pki/tls/certs/ca-bundle.crt

A more coincidental thing, the friend chain just added yesterday, the search problem happened to be encountered today?.

Reference link: https://www.htcp.net/337.html

Recommended Posts

CentOS 6/7 update curl
CentOS 8 (2)
CentOS 8 (1)
Update gcc to 6.4.0 in centos
How to Update to gcc4.9.x on Centos7
rhel7.2 yum uses CentOS update package
centos7 python3.7+vi
CentOS + Python3.6+
CentOS + Jenkins
1.5 Install Centos7
2019-07-09 CentOS7 installation
centos7_1708 installation
Centos 7.5 python3.6
CentOS7 update the latest kernel | RPM directly install the kernel
How to install and use Curl on CentOS 8