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
相关推荐
TsingtaoAI3 分钟前
企业实训:AI运维工程师实训——某外资商业银行
运维·人工智能
未来会更好yes4 分钟前
Alibaba Cloud Linux3.21.04 ModSecurity 3 + Nginx + OWASP CRS 完整安装流程
linux·waf·modsecurity
XH-hui5 分钟前
【打靶日记】HackMyVm 之 Twisted
linux·网络安全·hackmyvm·hmv
HIT_Weston6 分钟前
49、【Ubuntu】【Gitlab】拉出内网 Web 服务:http.server 单/多线程分析(一)
前端·ubuntu·gitlab
wadesir9 分钟前
Nginx安全加固指南(CentOS系统下的Web服务器安全配置实战)
服务器·nginx·安全
jinxinyuuuus13 分钟前
局域网文件传输:P2P架构中的带宽测量与高效率文件分块传输
服务器·架构·p2p
Evan芙15 分钟前
Rocky Linux 9 双网卡 bond0 绑定
linux·服务器·网络
保持低旋律节奏22 分钟前
linux——vim编辑器
linux·编辑器·vim
『 时光荏苒 』23 分钟前
生产服务器log日志文件很多-精准查询问题
运维·服务器·生产服务器问题查询·日志过滤
触想工业平板电脑一体机25 分钟前
【触想智能】工业触控一体机在工业应用中扮演的角色以及其应用场景分析
android·大数据·运维·电脑·智能电视