Ubuntu 20.04安装rsync 3.2.7

前言

Ubuntu 20.04的apt中不支持rsync 3.2.0+的安装,因此需要手动编译安装,记录下过程

bash 复制代码
~$ apt policy rsync
rsync:
  已安装:(无)
  候选: 3.1.2-2.1ubuntu1.6
  版本列表:
     3.1.3-8ubuntu0.7 -1
        100 /var/lib/dpkg/status

下载所需版本的rsync源码

https://github.com/RsyncProject/rsync/tags中选择对应版本,下载源码压缩包。

bash 复制代码
curl -L https://github.com/RsyncProject/rsync/archive/refs/tags/v3.2.7.zip -o rsync_3.2.7.zip
unzip rsync_3.2.7.zip
cd rsync_3.2.7

尝试编译rsync

参考How to build and install rsync,输入以下命令进行编译安装:

bash 复制代码
 ./configure
 make
 sudo make install

在第一步./configure就遇到了问题:

bash 复制代码
Configure found the following issues:

- Failed to find xxhash.h for xxhash checksum support.

See the INSTALL file for hints on how to install the missing libraries and/or
how to generate (or fetch) manpages:
    https://github.com/WayneD/rsync/blob/master/INSTALL.md

To disable one or more features, the relevant configure options are:
    --disable-xxhash

configure.sh: error: Aborting configure run

原因是rsync依赖xxhash,虽然可以通过加入--disable-xxhash参数禁用该功能,但我还是选择解决依赖问题。

安装依赖xxhash

xxhash的github仓库得知,构建xxHash方法如下:

bash 复制代码
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install xxhash

这个没啥问题,照做就可以了,就是./bootstrap-vcpkg.sh这一步可能需要代理,不然会很卡。

编译rsync

回到rsync,再次执行./configure,还是报Failed to find xxhash.h for xxhash checksum support.,说明他没搜到我们刚才编译的依赖,将刚才编译的依赖加入环境变量:

bash 复制代码
export CPATH=/path/to/vcpkg/installed/x64-linux/include:$CPATH
export LIBRARY_PATH=/path/to/vcpkg/installed/x64-linux/lib:$LIBRARY_PATH

再次执行rsync的编译安装命令就可以了。

bash 复制代码
 ./configure
 make
 sudo make install
相关推荐
conkl2 小时前
Linux 零基础万字入门指南(进阶详解版)
linux·运维·服务器·ssh·文件管理·shell·linux基础
一水鉴天6 小时前
认知系统的架构: 认知残余三角形、认知主体意识 和认知演进金字塔(腾讯元宝)
运维·服务器
三体世界6 小时前
Mysql基本使用语句(一)
linux·开发语言·数据库·c++·sql·mysql·主键
TT-Kun6 小时前
Linux 上手 UDP Socket 程序编写(含完整具体demo)
linux·计算机网络·udp
一川风絮千片雪6 小时前
【环境配置】Linux/Ubuntu24.04 无图形界面安装显卡驱动
linux·运维·服务器
Giser探索家6 小时前
低空智航平台技术架构深度解析:如何用AI +空域网格破解黑飞与安全管控难题
大数据·服务器·前端·数据库·人工智能·安全·架构
Danileaf_Guo7 小时前
Ubuntu 18.04快速配置WireGuard互联
linux·运维·服务器·ubuntu
柳鲲鹏7 小时前
Ubuntu下载、安装、编译指定版本python
运维·服务器·ubuntu
快乐就是哈哈哈7 小时前
从零部署 MySQL 数据库:Linux 安装与防火墙策略全解析
linux·mysql
画中有画7 小时前
使用AI编程自动实现自动化操作
运维·自动化·ai编程·rpa·自动化脚本·冰狐智能辅助