介绍:
查看当前版本: rsync --version
找到安装目录:which rsync
在管网处下载最新tar.gz包,解压后,进入目录,依次执行以下命令:
第一步:
######配置
sudo ./configure --prefix=/usr/local
######升级新版本可能会报错:
Configure found the following issues: - Failed to find xxhash.h for xxhash checksum support. - Failed to find zstd.h for zstd compression support. - Failed to find lz4.h for lz4 compression 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/RsyncProject/rsync/blob/master/INSTALL.md To disable one or more features, the relevant configure options are: --disable-xxhash --disable-zstd --disable-lz4 configure.sh: error: Aborting configure run
解决的命令:sudo ./configure --disable-xxhash --disable-zstd --disable-lz4
第二步:
#####编译和安装
# 检查是否成功生成 Makefile:
ls -l Makefile
依次执行下述命令: 1.make 2. sudo make install
第三步:验证是否成功升级: rsync -version
如果提示:-bash: /usr/bin/rsync: No such file or directory 则执行 : hash -r ##清除shell路径缓存,在某些情况下,Shell 可能会缓存路径信息