1、下载最新版本:Release v3.4.1 · RsyncProject/rsync · GitHub
2、运行:./configure --prefix=/usr/local/rsync
报错:
1)Failed to find openssl/md4.h and openssl/md5.h for openssl crypto lib support
原因是libssl-dev 没有安装,执行:
sudo apt-get install libssl-dev
2)Failed to find xxhash.h for xxhash checksum support
这通常意味着你的开发环境中缺少了 xxHash 库的头文件。xxHash 是一个非常快的哈希算法库,常用于提供快速的数据校验和。以下是一些解决这个问题的步骤:
安装 xxHash 库
首先,确保你的系统上安装了 xxHash 库。安装方法取决于你使用的操作系统:
对于 Ubuntu/Debian 系统:
sudo apt-get update
sudo apt-get install libxxhash-dev
对于 CentOS/RHEL 系统:
sudo yum install xxhash-devel
对于 Fedora 系统:
sudo dnf install xxhash-devel
对于 Arch Linux:
sudo pacman -S xxhash
对于 macOS(使用 Homebrew):
brew install xxhash
3)Failed to find zstd.h for zstd compression support
要解决找不到 zstd.h 的问题,通常是因为你的系统中没有安装 zstd 库,或者库文件没有被正确地包含在编译器的搜索路径中。以下是一些步骤来帮助你解决这个问题:
安装 zstd 库
首先,确保你的系统上安装了 zstd 库。根据你的操作系统,安装方法会有所不同:
对于 Ubuntu/Debian 系统:
sudo apt-get update
sudo apt-get install libzstd-dev
4)Failed to find lz4.h for lz4 compression support
在使用 LZ4 压缩库时遇到“Failed to find lz4.h”的错误通常意味着编译器无法找到 LZ4 库的头文件。LZ4 是一个非常流行的压缩库,它提供了快速的压缩和解压速度。解决这个问题,你可以按照以下步骤操作:
安装 LZ4 库
首先,确保你的系统上已经安装了 LZ4 库。根据你的操作系统,安装方法会有所不同:
对于 Ubuntu/Debian 系统:
sudo apt-get install liblz4-dev
3、安装
sudo apt install -y gcc g++ gawk autoconf automake python3-cmarkgfm
sudo apt install -y acl libacl1-dev
sudo apt install -y attr libattr1-dev
sudo apt install -y libxxhash-dev
sudo apt install -y libzstd-dev
sudo apt install -y liblz4-dev
sudo apt install -y libssl-dev
make
make install
4、重启服务
ln -s /usr/local/rsync/bin/rsync /usr/bin/