1、查看当前版本
# curl --version
curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.19.1 Basic ECC zlib/1.2.7 libidn/1.28 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz
2、下载curl 8.4.0:
https://curl.se/download/curl-8.4.0.tar.gz
3、编译安装curl8.4.0
tar -zxf curl-8.4.0.tar.gz
cd curl-8.4.0
./configure --prefix=/usr/local/curl --without-ssl
sudo make
sudo make install
chmod 755 -R /usr/local/curl
chmod 755 /usr/bin/curl
mv /usr/bin/curl{,.bak20231015}
cp /usr/local/curl/bin/curl /usr/bin/curl
cp /etc/profile{,.bak20231015}
echo "export PATH=\$PATH:/usr/local/curl/bin" >> /etc/profile
source /etc/profile
安装后再次检查升级后版本情况
# curl --version
curl 8.4.0 (x86_64-pc-linux-gnu) libcurl/8.4.0 zlib/1.2.7
Release-Date: 2023-10-11
Protocols: dict file ftp gopher http imap mqtt pop3 rtsp smtp telnet tftp
Features: alt-svc AsynchDNS IPv6 Largefile libz UnixSockets