虚心使人进步

虚心学习,天天向上......
随笔 - 274, 文章 - 2, 评论 - 161, 阅读 - 76万
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

centos 更新curl版本

Posted on   Showker  阅读(125)  评论(0编辑  收藏  举报

How to Build and Install Latest cURL Version on CentOS

# Written by The Suhu (2021).

# Tested on CentOS 7 and CentOS 8

Previously I've written about How to Build and Install Latest cURL Version on Ubuntu. In this article in this article explain how to build and install latest cURL version on CentOS.

The default cURL installed on the operating system may not be the latest version. if you want the latest version, then you need to build from the source. Let’s check the cURL version installed with the following command.

[thesuhu@centos-8-1 ~]$ curl --version
curl 7.61.1 (x86_64-redhat-linux-gnu) libcurl/7.61.1 OpenSSL/1.1.1g zlib/1.2.11 brotli/1.0.6 libidn2/2.2.0 libpsl/0
.20.2 (+libidn2/2.2.0) libssh/0.9.4/openssl/zlib nghttp2/1.33.0
Release-Date: 2018-09-05
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps 
telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz brotli TLS-SRP HTTP2 UnixSocke
ts HTTPS-proxy PSL 

Above shows the installed cURL version 7.61.0. While currently the latest version of cURL is 7.80.0. Go to https://curl.se/download/ to check the latest cURL version.

Download cURL latest version

Before we download the latest version of cURL, let’s update the system. It’s optional but I prefer to do this to keep the installed packages up to date.

sudo yum update -y

Install required packages.

sudo yum install wget gcc openssl-devel make -y

Download the latest cURL source. In this tutorial we will download 7.80.0 version.

wget https://curl.haxx.se/download/curl-7.80.0.tar.gz

Then extract the downloaded.

tar -xzvf curl-7.80.0.tar.gz

Building cURL

Go to the extracted directory of downloaded cURL source file.

cd curl-7.80.0

Now it’s time to build with configure command.

./configure --prefix=/usr/local --with-ssl

Make sure there are no errors from the above command execution. If there are no errors, finally we can install it with the make command.

make
sudo make install
sudo ldconfig

New version check

To make sure the new version is installed successfully, open a new session from terminal/ssh and run the command:

[thesuhu@centos-8-1 ~]$ curl --version
curl 7.80.0 (x86_64-pc-linux-gnu) libcurl/7.80.0 OpenSSL/1.1.1k-fips zlib/1.2.11
Release-Date: 2021-11-10
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet 
tftp 
Features: alt-svc AsynchDNS HSTS HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL TLS-SRP UnixSockets

The cURL version should be 7.80.0.

The fast way

If you don't want to bother running commands one by one, you can create the script file below and run it.

#! /bin/bash

# Tested on CentOS 7 and CentOS 8
# Check the latest version at https://curl.se/download/
VERSION=7.80.0

cd ~
sudo yum update -y
sudo yum install wget gcc openssl-devel make -y
wget https://curl.haxx.se/download/curl-${VERSION}.tar.gz
tar -xzvf curl-${VERSION}.tar.gz 
rm -f curl-${VERSION}.tar.gz
cd curl-${VERSION}
./configure --prefix=/usr/local --with-ssl
make
sudo make install
sudo ldconfig
cd ~
rm -rf curl-${VERSION}

That's all and if you find it useful please star (⭐) & share.

相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 一文读懂知识蒸馏
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
历史上的今天:
2013-07-24 innodb数据库批量转换表引擎为MyISAM
2010-07-24 Flex4:利用HttpService与ASP.NET传输JSON数据(登录为例)
点击右上角即可分享
微信分享提示