当前位置: 首页 > article >正文

Centos编译升级libcurl

Centos编译升级libcurl

  • ‌下载最新版源码包
  • 安装编译依赖
  • 配置编译选项
    • 如果报错:
      • 通过 EPEL 仓库安装
      • 手动源码编译安装
    • 如果报错:
      • 安装Brotli 开发库
    • 如果报错:
      • 方法一:安装 libpsl-devel 依赖
        • 通过 EPEL 仓库安装
        • 重新运行 configure
      • 方法二:禁用 PSL 支持
  • ‌编译并安装
  • 替换系统旧版本

‌下载最新版源码包

访问curl官网获取最新版本(如8.12.1):

wget https://curl.se/download/curl-8.12.1.tar.gz
tar -zxvf curl-8.12.1.tar.gz && cd curl-8.12.1

安装编译依赖

yum groupinstall 'Development Tools' -y
yum install openssl-devel libnghttp2-devel -y

配置编译选项

./configure --prefix=/usr/local/curl --with-brotli --with-openssl

若需禁用特定功能(如LDAP),可添加–disable-ldap等参数‌

如果报错:

configure: error: libpsl libs and/or directories were not found where specified!

通过 EPEL 仓库安装

# 安装 EPEL 仓库
yum install epel-release -y

# 更新仓库缓存
yum clean all && yum makecache

# 安装 libpsl-devel
yum install libpsl-devel -y

手动源码编译安装

# 安装编译依赖
yum install wget gcc make pkg-config -y

# 下载 libpsl 源码
wget https://github.com/rockdaboot/libpsl/releases/download/0.21.5/libpsl-0.21.5.tar.gz
# 解压并编译
tar -zxvf libpsl-0.21.5.tar.gz
cd libpsl-0.21.5
./configure
make
sudo make install

# 更新动态库缓存
sudo ldconfig

如果报错:

configure: error: BROTLI libs and/or directories were not found where specified!

安装Brotli 开发库

yum install brotli-devel -y

如果报错:

configure: error: libpsl libs and/or directories were not found where specified!

方法一:安装 libpsl-devel 依赖

通过 EPEL 仓库安装
# 确保已启用 EPEL 仓库
yum install epel-release -y

# 安装 libpsl-devel
yum install libpsl-devel -y

重新运行 configure
./configure --prefix=/usr/local/curl --with-brotli --with-openssl

方法二:禁用 PSL 支持

如果不需要 ‌Public Suffix List‌ 功能(例如域名后缀解析),可在配置时直接禁用:

./configure --prefix=/usr/local/curl --with-brotli --with-openssl

‌编译并安装

make && make install

替换系统旧版本

mv /usr/bin/curl /usr/bin/curl.bak  # 备份旧版本
cp /usr/local/curl/bin/curl /usr/bin/curl
echo "/usr/local/curl/lib" > /etc/ld.so.conf.d/curl.conf
ldconfig  # 更新动态库缓存

http://www.kler.cn/a/596752.html

相关文章:

  • DeepSeek自学手册:《从理论(模型训练)到实践(模型应用)》|73页|附PPT下载方法
  • NVM 多版本node.js管理工具
  • Linux用户管理实操指南
  • 【 <二> 丹方改良:Spring 时代的 JavaWeb】之 Spring Boot 中的异常处理:全局异常与自定义异常
  • Ubuntu 系统安装 Redis 的详细步骤
  • Android13音频子系统分析(四)---座舱的多音区框架
  • 亮相AWE2025,MOVA以科技重塑生活,以美学沟通世界
  • go:前后端分离
  • Agent Team 多智能体系统解析
  • 【redis】事务详解,相关命令multi、exec、discard 与 watch 的原理
  • 嵌入式系统的核心组成部分处理器、存储器、传感器和执行器
  • 正则表达式详解(regular expression)
  • 掌握 Zapier:从入门到精通的自动化指南
  • 企业选择网站服务器租用需要注意哪些?
  • iptables和netfilter内部报文处理
  • 好未来25校招Web前端开发工程师部分笔试题解析
  • 雷军从 6 楼扔涂有防弹涂层西瓜,西瓜完好无损,这种防弹涂层是什么材质?用在车上效果怎么样?
  • macOS 使用 enca 识别 文件编码类型(比 file 命令准确)
  • 为扣子智能体接入 DeepSeek
  • Z型隶属函数(Z-shaped Membership Function)的详细介绍及python示例