当前位置首页 > CentOS知识

CentOS7更新curl为最新版本

阅读次数:232 次  来源:admin  发布时间:

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

上一篇:iis在windows系统打开
下一篇:Ubuntu(Debian):apt-get:处理repository数字签名无效、过期、没有签名:即如何强制apt-getup