Linux 离线升级 RSYNC

news/2025/4/1 20:47:17/文章来源:https://www.cnblogs.com/Javaer1995/p/18703059

前言:本文操作是在 CentOS-7 下执行的,不确定在其他 Linux 发布版是否能同样正常执行。

1、检查前置依赖组件

image

在安装 rsync 之前,需要确认已安装了相关依赖组件: gcc 、openssl-devel 、xxhash 、zstd 、lz4 。

rpm -qa | grep gcc
rpm -qa | grep openssl-devel
which xxhsum
which zstd
which lz4

相关前置依赖组件的具体离线安装方法请参考:

  • CentOS-7离线安装gcc

  • CentOS-7离线安装openssl-devel

  • Linux 离线安装 xxhash

  • Linux 离线安装 zstd

  • Linux 离线安装 lz4

2、查询rsync当前版本号

image

rsync --version

3、下载新版本安装包

官网下载地址:https://rsync.samba.org/

image

本示例安装包的直接下载地址为:https://download.samba.org/pub/rsync/src/rsync-3.4.1.tar.gz

4、上传安装包到服务器

image

5、解压rsync安装包

image

tar -zxvf 新版本安装包名称

6、配置rsync

image

cd 新版本安装包解压目录
./configure

注意:如果没有先安装第一节提到的相关前置依赖组件,那么在配置 rsync 时可能会失败:
image

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类型字节数

image

vi config.status

image

经过配置后,在 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

image

make

注意:如果没有执行第七节的修改 rsync 类型字节数操作,那么在编译 rsync 时可能会失败:
image
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

image

make install

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

image

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】

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/908306.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

AireOS WLC安装License报错

​1.概述 本文主要记录在AireOS的WLC上安装License错误的情况。License的类型也是传统的License,因为设备的型号已经EOL,相关的资料应该较少,这里进行可能问题的记录。 2.适用场景 型号:WLC2500,WLC5508 License类型:传统License文件,如.lic的文件类型。 其他的型号多数…

在VS2022中练习“栈”

1.vs不能使用#include<stdio.h>等c语言的头文件 解决方法: 在vs instuall中“c++控制台应用”右边的方框,点击它,从它的列表中找到windowsSDK10,点击安装,等待即可

weak_auth 攻防世界 简单密码

根据题目得知考察简单密码。 admin 123456 。。。。。。。

基于PI控制器的车辆行驶控制系统simulink建模与仿真

1.课题概述基于PI控制器的车辆行驶控制系统是一种常见的控制策略,它利用比例-积分(Proportional-Integral, PI)控制器来调整车辆的速度或方向以达到期望值。在本课题中,我们将完成基于PI控制器的车辆行驶控制系统simulink建模与仿真。通过PI控制器分别对车辆形式的角度和车…

cookie 攻防世界 应该不难的题 未完成。

看到的是这些 根据题目信息,关键信息在cookie中。f12看有look here 看到: 所以访问: 有该提示,需要看http响应。 应该就是要用burp来做了。这电脑没burp搁置。

分解因数

代码展示: #include <bits/stdc++.h> // 包含了几乎所有C++标准库头文件的万能头文件(不推荐在实际项目中使用,可能导致编译问题和命名冲突,但在竞赛等场景方便) using namespace std; // 使用标准命名空间,这样可以直接使用标准库中的函数和类型,无需加上std::…

请简述 Java 的内存模型,以及栈、堆、方法区分别存储什么内容?

jdk8以前jdk8以后内存分出的数据区域:程序计数器,Java 虚拟机栈,本地方法栈,堆,方法区,运行时常量池,字符串常量池。 栈: 局部变量表:存放方法参数和方法内定义的局部变量,包括基本数据类型(byte、short、int、long、float、double、char、boolean )以及对象引用。…

基于GA遗传优化TCN时间卷积神经网络时间序列预测算法matlab仿真

1.算法运行效果图预览 (完整程序运行后无水印) 2.算法运行软件版本 matlab2022a3.部分核心程序 (完整版代码包含详细中文注释和操作步骤视频)FieldD = [rep([10],[1,Nums]);Areas;rep([0;0;0;0],[1,Nums])];gen = 0; Js = 0.5*rand(NIND,1); Objv = (Js+eps); gen =…

project4

完结撒花!记录一下 Bustub Concurrency Control 的实现过程。 Resourceshttps://15445.courses.cs.cmu.edu/fall2022 课程官网 https://github.com/cmu-db/bustub Bustub Github Repo https://www.gradescope.com/ 自动测评网站 GradeScope,course entry code: PXWVR5 https:…

backup 攻防世界 index.php 备份文件。

点进去看到的: index.php 文件经常有备份,要安全嘛,常用的备份文件有: index.php.bak index.php.swp index.php~ index.php.old index.php.backup 试出来就能有flag了