前言
CentOS6的curl版本是7.19.7,执行命令访问网站后得到数据不正确,需要更新版本。
升级步骤
1. 备份证书
# cp /etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/ca-bundle.crt.bak
# curl http://curl.haxx.se/ca/cacert.pem -o /etc/pki/tls/certs/ca-bundle.crt
2. 新增 repo
使用 city-fan 的更新源来更新
# 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/rhel6/x86_64/
enabled=0
gpgcheck=0
3.更新 curl
直接使用如下命令进行更新:
# yum update curl --enablerepo=CityFanforCurl -y
4.查看 curl版本
# curl --version
curl 7.68.0 (x86_64-redhat-linux-gnu) libcurl/7.68.0 OpenSSL/1.0.1e-fips zlib/1.2.3 c-ares/1.15.0 libssh2/1.8.2 nghttp2/1.6.0
Release-Date: 2020-01-08
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 GSS-API HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz Metalink NTLM NTLM_WB SPNEGO SSL UnixSockets