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


作者:习惯沉淀

如果文中有误或对本文有不同的见解,欢迎在评论区留言。

如果觉得文章对你有帮助,请点击文章右下角【推荐】一下。您的鼓励是博主的最大动力!

扫码关注一线码农的学习见闻与思考。

回复"大数据","微服务","架构师","面试总结",获取更多学习资源!
原文地址:https://www.cnblogs.com/yadongliang/p/14679960.html