当前位置:网站首页>rpm2rpm 打包步骤
rpm2rpm 打包步骤
2022-06-30 12:13:00 【Erik_ly】
本文主要介绍将 rpm 包解压后,修改里面的文件,然后重新打包成 rpm 的过程。
准备环境
- 安装rpm-build包
yum install rpm-build -y
- 安装rpmdevtools
yum install rpmdevtools -y
- 创建工作空间
rpmdev-setuptree
查看工作目录

- 创建 BUILDROOT目录
mkdir /root/rpmbuild/BUILDROOT
完整目录结构

解压 rpm 包
- 复制文件
复制需要修改的 rpm 包至 /root/rpmbuild/BUILDROOT/ 目录,

- 解压 rpm 包
cd /root/rpmbuild/BUILDROOT
rpm2cpio zookeeper_3_0_1_0_187-3.4.6.3.0.1.0-187.noarch.rpm | cpio -idv
- 提取 spec 文件
rpmrebuild --package --notest-install --spec-only=zookeeper.spec zookeeper_3_0_1_0_187-3.4.6.3.0.1.0-187.noarch.rpm
注:这里用到了rpmrebuild工具,具体可查看:使用rpmrebuild从rpm包中提取spec文件,有下载链接和使用方法。
- 移动 SPEC 文件
mv zookeeper.spec /root/rpmbuild/SPECS/
- 删除原 rpm 包
rm -rf zookeeper_3_0_1_0_187-3.4.6.3.0.1.0-187.noarch.rpm
修改内容
查看解压后的文件内容,

按自己需要进行修改,
- 如果只是需要替换同名文件,则直接进行替换即可;
- 如果需要增加文件或文件夹,则需要在
zookeeper.spec中按原有格式添加文件或文件夹; - 如果需要删除文件或文件夹,也需要在
zookeeper.spec中删除相应的文件或文件夹。 - 如果修改的文件较多,也可以将原有的
%files内容改为
%files
%defattr(-,root,root,-)
/usr/hdp/3.0.1.0-187
重新打 rpm 包
修改好文件后,重新打包成 rpm 文件,
cd /root/rpmbuild/SPECS
rpmbuild -ba --buildroot /root/rpmbuild/BUILDROOT/ zookeeper.spec

执行完成后在 /root/rpmbuild/RPMS 目录中查看新的 rpm 包

注:本文首发于个人博客网站: http://www.erik-ly.com/
边栏推荐
- Global capital market 101: Breit, one of the best investment targets for domestic high net worth people
- 90.(cesium篇)cesium高度监听事件
- Two batches of pure milk are unqualified? Michael responded that he was conducting a large-scale screening and sampling inspection of products
- MySQL中变量的定义和变量的赋值使用
- grep匹配查找
- 60 个神级 VS Code 插件!!
- Substrate 源码追新导读: Call调用索引化, 存储层事物化全面完成
- Pharmacy management system
- 腾讯二面:@Bean 与 @Component 用在同一个类上,会怎么样?
- Building a database model using power designer tools
猜你喜欢

Building a database model using power designer tools

SuperMap iclient3d for webgl loading TMS tiles

Use of polarplot function in MATLAB

Set set

【一天学awk】数组的使用

Apple executives openly "open the connection": Samsung copied the iPhone and only added a large screen

90. (cesium chapter) cesium high level listening events

Wechat launched the picture big bang function; Apple's self-developed 5g chip may have failed; Microsoft solves the bug that causes edge to stop responding | geek headlines

MySQL built-in functions

How to select an OLAP database engine?
随机推荐
【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(二)
How to detect 3D line spectral confocal sensors in semiconductors
海思3559 sample解析:venc
Map集合
SQLSERVER 查询编码是 936 简体中文GBK,那我是写936 还是写GBK?
SuperMap 3D SDKs_ Unity plug-in development - connect data services for SQL queries
Hisilicon 3559 developing common sense reserves: a complete explanation of related terms
1175. prime number arrangement: application of multiplication principle
Redis的基本操作的命令
不同类型的变量与零究竟是如何比较
JMeter性能测试工作中遇到的问题及剖析,你遇到了几个?
Double dqn notes
MySQL built-in functions
[bug solution] fiftyone reports attributeerror: module 'CV2' has no attribute 'GAPI_ wip_ gst_ Gstreamerpipeline 'error resolution
How do different types of variables compare with zero
Google refutes rumors and gives up tensorflow. It's still alive!
Apple executives openly "open the connection": Samsung copied the iPhone and only added a large screen
FlinkSQL自定义UDAF使用的三种方式
使用Power Designer工具构建数据库模型
【惊了】迅雷下载速度竟然比不上虚拟机中的下载速度