Ubuntu22.04 下安装Curl库

1. apt 安装:

sudo apt-get install libcurl4

重装:

sudo apt-get install --reinstall libcurl4

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

猜你喜欢

转载自blog.csdn.net/coco_1998_2/article/details/139490819