Linux 离线升级 RSYNC
前言:本文操作是在 CentOS-7 下执行的,不确定在其他 Linux 发布版是否能同样正常执行。
1、检查前置依赖组件

在安装 rsync 之前,需要确认已安装了相关依赖组件: gcc 、openssl-devel 、xxhash 、zstd 、lz4 。
rpm -qa | grep gcc
rpm -qa | grep openssl-devel
which xxhsum
which zstd
which lz4
相关前置依赖组件的具体离线安装方法请参考:
2、查询rsync当前版本号

rsync --version
3、下载新版本安装包
官网下载地址:https://rsync.samba.org/

本示例安装包的直接下载地址为:https://download.samba.org/pub/rsync/src/rsync-3.4.1.tar.gz
4、上传安装包到服务器

5、解压rsync安装包

tar -zxvf 新版本安装包名称
6、配置rsync

cd 新版本安装包解压目录
./configure
注意:如果没有先安装第一节提到的相关前置依赖组件,那么在配置 rsync 时可能会失败:
Configure found the following issues:
- Failed to find openssl/md4.h and openssl/md5.h for openssl crypto lib support.
- 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-openssl
--disable-xxhash
--disable-zstd
--disable-lz4
configure.sh: error: Aborting configure run
7、修改rsync类型字节数

vi config.status

经过配置后,在 config.status 文件中,上述 rsync 类型字节数的值可能为 0 ,需要修改为合适的值(见上图)。
D["SIZEOF_INT"]=" 4"
D["SIZEOF_LONG"]=" 8"
D["SIZEOF_LONG_LONG"]=" 8"
D["SIZEOF_SHORT"]=" 2"
D["SIZEOF_INT16_T"]=" 2"
D["SIZEOF_UINT16_T"]=" 2"
D["SIZEOF_INT32_T"]=" 4"
D["SIZEOF_UINT32_T"]=" 4"
D["SIZEOF_INT64_T"]=" 8"
D["SIZEOF_OFF_T"]=" 8"
D["SIZEOF_OFF64_T"]=" 8"
D["SIZEOF_TIME_T"]=" 8"
D["SIZEOF_CHARP"]=" 8"
8、编译rsync

make
注意:如果没有执行第七节的修改 rsync 类型字节数操作,那么在编译 rsync 时可能会失败:
gawk -f ./daemon-parm.awk ./daemon-parm.txt
gawk -f ./mkproto.awk ./*.c ./lib/compat.c daemon-parm.h
In file included from ./rounding.c:20:0:
./rsync.h:614:3: 错误:#error Could not find a 32-bit integer variable
# error Could not find a 32-bit integer variable
^
./rsync.h:683:2: 错误:未知的类型名‘int32’
int32 size, entries;
^
./rsync.h:684:9: 错误:expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘attribute’ before ‘node_size’
uint32 node_size;
^
./rsync.h:690:2: 错误:未知的类型名‘int32’
int32 key;
^
./rsync.h:774:3: 错误:#error Character pointers are not 4 or 8 bytes.
# error Character pointers are not 4 or 8 bytes.
^
./rsync.h:787:2: 错误:未知的类型名‘int32’
int32 num;
.........................
.........................
^
./proto.h:316:28: 错误:未知的类型名‘int32’
void see_token(char *data, int32 toklen);
^
./proto.h:369:8: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘fuzzy_distance’
uint32 fuzzy_distance(const char *s1, unsigned len1, const char *s2, unsigned len2, uint32 upperlimit);
^
./rounding.c: 在函数‘main’中:
./rounding.c:35:13: 警告:变量‘test_array’被设定但未被使用 [-Wunused-but-set-variable]
static int test_array[1 - 2 * (ACTUAL_SIZE != EXPECTED_SIZE)];
^
Failed to create rounding.h!
make: *** [rounding.h] 错误 1
9、安装rsync

make install
10、查询rsync升级后的版本号

rsync --version
提示:完成升级后,新版本号需要退出重新登录访问才能查询到,否则查到的是旧版本号。
本文参考
【1】【Rsync缓冲区溢出与信息泄露漏洞(CVE-2024-12084/CVE-2024-12085)通告】【绿盟科技】【2025-01-16】
【2】【Rsync 缓冲区溢出漏洞(CVE-2024-12084)】【启明星辰】【2025-01-17】
【3】【liuxiao】【64位centos上rsync源码编译时报错未知类型int32】【CSDN】【2022-01-22】
【4】【qqliuxiaoran】【build fail on ky10 arm】【github】【2023-02-10】
【5】【CentOS 升级RSync:轻松实现版本升级,解锁数据同步新效能!】【云原生实践】【2025-01-21】
【6】【men_nang】【rsync 版本升级】【CSDN】【2025-01-24】
【7】【JesJiang】【rsync离线安装】【CSDN】【2020-04-15】
Linux 离线升级 RSYNC的更多相关文章
- []Linux 离线升级Openssh与Openssl版本
https://blog.csdn.net/qq_45728838/article/details/120825845 离线的意思是为Linux无法链接网络,只能通过windows 将文件上传一.首先 ...
- Linux CentOS 8系统离线升级内核版本
Linux CentOS 8系统离线升级内核版本 搬运如下文章,十分感谢 https://blog.csdn.net/WQwinter/article/details/127231086 二.升级步骤 ...
- centos7 离线升级/在线升级操作系统内核
目录 一.前言 二.系统环境 三.系统内核下载网址 四.centos7离线升级系统内核 1.先查看系统环境 2.离线升级系统内核 五.在线升级系统内核 一.前言 CentOS(Community EN ...
- linux 内核升级
LINUX 内核升级 linux 内核官网 https://www.kernel.org/ POST BIOS(boot sequence) 所选择的启动设备次序的MBR中是否有引导程序, ----& ...
- linux内核升级图文攻略(转)
一.Linux内核概览Linux是一个一体化内核(monolithic kernel)系统.设备驱动程序可以完全访问硬件.Linux内的设备驱动程序可以方便地以模块化(modularize)的形式设置 ...
- Android Studio下载及离线升级方法
由于众所周知的原因,android官网无法访问,所以我们要用到翻.墙.工具,我用的是自.由.门,大家自行搜索下载. android studio下载地址: https://dl.google.com/ ...
- ubuntu Linux离线安装软件包
ubuntu Linux离线安装软件包 http://www.myir-tech.com/bbs/thread-337-1-1.html(出处: 米尔科技论坛) 方法一 在可上网的ubuntu电脑上, ...
- linux内核升级图文攻略
Linux内核概览 Linux是一个一体化内核(monolithic kernel)系统. 设备驱动程序可以完全访问硬件. Linux内的设备驱动程序可以方便地以模块化(modularize)的形式设 ...
- Linux安装/升级pip
Linux安装/升级pip 1.执行脚本 # wget https://bootstrap.pypa.io/get-pip.py # 如果没有 wget,先安装 wget # yum -y insta ...
- linux 内核升级2 转
linux内核升级 一.Linux内核概览 Linux是一个一体化内核(monolithic kernel)系统. 设备驱动程序可以完全访问硬件. Linux内的设备驱动程序可以方便地以模块化(mod ...
随机推荐
- 我的新书《C#上位机开发实战指南》出版了
-Begin- 大家好!我是付工. 2022年的时候,我萌生了编写一本上位机书籍的想法,希望能给更多的上位机学习者提供一些帮助,经历了2年多的时间,今年的8月份,这本书终于出版了. 初衷 十年前,我也 ...
- Solution Set -「OurOJ Contest #2587」浅写
\(\mathscr A\sim\)「OurOJ #47030」_ Link & Submission & Tags:「A.DP-计数 DP」「A.数学-Stirling 数/反演 ...
- 双指针习题:Binary Deque
14.Binary Deque 题面翻译 Binary Deque - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 有多组数据. 每组数据给出 \(n\) 个数,每个数为 \(0\) ...
- nc命令-Netcat (网络刀)
https://blog.csdn.net/freeking101/article/details/53289198 nc参数 1) -l 用于指定nc将处于侦听模式.指定该参数,则意味着nc被当作s ...
- Linux重要的日志文件
1./var/log/boot.log 该文件记录了系统在引导过程中发生的事件,就是Linux系统开机自检过程显示的信息 2./var/log/syslog 只记录警告信息,常常是系统出问题的信息,所 ...
- Linux下Docker及Nvidia Container ToolKit安装教程
作者:SkyXZ CSDN:SkyXZ--CSDN博客 博客园:SkyXZ - 博客园 我们接下来在Ubuntu中安装Docker(安装详见:Get Docker | Docker Docs)及NVI ...
- jenkins+svn+tomcat
1.安装插件即可在源码管理中看见svn的选项subversion2.源码管理中配置svn的工程地址 3.点击Credentials的[添加]配置svn的用户名密码,完成后选取即可 4.配置构建触发器, ...
- 流程控制之if选择结构
if单选择结构 if (布尔表达式){ //如果布尔表达式为ture将执行的语句 } 实例: package com.yeyue.struct; import java.util.Sc ...
- mysqldump从mysql迁移数据到OceanBase
使用mysqldump导出数据 /usr/bin/mysqldump --single-transaction -B employees -S /data/mysql/mysql.sock -uroo ...
- 《<吕氏春秋> 刘本》
<<吕氏春秋> 刘本>(卷三) 编者 刘昱合 其他版本 <吕氏春秋>(卷一) <吕氏春秋>(卷二) <<吕氏春秋> 全本>(卷三 ...

