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
相关推荐
渲染101专业云渲染几秒前
川翔云电脑优势总结
服务器·3d·电脑·blender·maya
chian-ocean18 分钟前
Linux 文件缓冲区:高效数据访问的幕后推手
linux·运维·服务器
加油=^_^=20 分钟前
【Linux】进程优先级 | 进程调度(三)
linux·运维·服务器
若云止水29 分钟前
Ubuntu 下 nginx-1.24.0 源码分析 - ngx_init_cycle 函数 - 详解(4)
数据库·nginx·ubuntu
橘子味的茶二30 分钟前
高级系统架构师--第十章:计算机网络
服务器·计算机网络·系统架构
吃汤圆的抹香鲸1 小时前
GoLand 安装包 绿色版 Win,Mac,Linux 包含IntelliJ全家桶 专为Go语言设计的集成开发环境(IDE)
linux·windows·macos·go·intellij-idea·go1.19
紫菜(Nori)1 小时前
短连接服务器压测-wrk
服务器·压力测试
追寻光1 小时前
Cannot find a valid baseurl for repo: base/7/x86_64
linux
元气满满的热码式1 小时前
Docker数据卷操作实战
linux·运维·docker·云原生·容器
陆沙1 小时前
deepseek-r1-centos-本地服务器配置方法
linux·服务器·centos