CentOS 7 更新 curl 為最新版本


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=0
gpgcheck=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.7
Release-Date: 2021-04-14
Protocols: 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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM