1. apt 安装:
sudo apt-get install curl
2. 官网压缩包:
下载地址:curl downloads
wget https://curl.haxx.se/download/curl-7.78.0.tar.gz
tar -xzvf curl-7.78.0.tar.gz
cd curl-7.78.0
./configure --with-openssl
make
sudo make install
3. Github源码安装:
git clone https://github.com/curl/curl.git
cd curl
只有configure.ac,没有configure文件。运行下面命令生成configure文件:
aclocal
autoconf
autoreconf -vif
生成configure文件后,运行:
./configure --with-openssl
没有运行 “autoreconf -vif”,会报下面错误:
make
sudo make install
4.验证
curl --version
curl www.baidu.com