CentOS 7 更新 curl 为最新版本
转载自:https://tool.4xseo.com/article/74440.html
==========================
摘要:
0x01介绍由于CentOS7内置的curl和libcurl源为较旧的7.29.0,不支持一些新特性且有安全性问题,所以需要更新一下。0x02如何更新在这里使用city-fan的更新源来更新。
<< 收起0x01 介绍
由于 CentOS 7 内置的 curl 和 libcurl 源为较旧的 7.29.0,不支持一些新特性且有安全性问题,所以需要更新一下。
0x02 如何更新
在这里使用 city-fan 的更新源来更新。
1. 更新 ca-bundle
1. 首先备份一下:
cp /etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/ca-bundle.crt.bak
2. 更新并替换:
curl http://curl.haxx.se/ca/cacert.pem -o /etc/pki/tls/certs/ca-bundle.crt
2. 新增 repo 源
1. 新增 repo:
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=0gpgcheck=0
3. 更新 curl
直接使用如下命令进行更新:
yum update curl --enablerepo=CityFanforCurl -y
更新完成后,建议重启一下。就可以正常使用了。
查看版本:
[root@VM-0-17-centos local]# curl -V curl 7.76.1 (x86_64-redhat-linux-gnu) libcurl/7.60.0 OpenSSL/1.0.2k zlib/1.2.7Release-Date: 2021-04-14Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp Features: AsynchDNS HTTPS-proxy IPv6 Largefile libz Metalink NTLM NTLM_WB SSL UnixSockets WARNING: curl and libcurl versions do not match. Functionality may be affected.
感谢
https://www.htcp.net/337.html