当前位置:网站首页>Rpm2rpm packaging steps
Rpm2rpm packaging steps
2022-06-30 13:42:00 【Erik_ ly】
List of articles
This article mainly introduces will rpm After unpacking the package , Modify the file inside , And repackage it into rpm The process of .
Prepare the environment
- install rpm-build package
yum install rpm-build -y
- install rpmdevtools
yum install rpmdevtools -y
- Create a workspace
rpmdev-setuptree
Check the working directory

- establish BUILDROOT Catalog
mkdir /root/rpmbuild/BUILDROOT
Complete directory structure

decompression rpm package
- Copy file
Copy to be modified rpm Package to /root/rpmbuild/BUILDROOT/ Catalog ,

- decompression rpm package
cd /root/rpmbuild/BUILDROOT
rpm2cpio zookeeper_3_0_1_0_187-3.4.6.3.0.1.0-187.noarch.rpm | cpio -idv
- extract spec file
rpmrebuild --package --notest-install --spec-only=zookeeper.spec zookeeper_3_0_1_0_187-3.4.6.3.0.1.0-187.noarch.rpm
notes : It's used here rpmrebuild Tools , Details can be viewed : Use rpmrebuild from rpm Extract in package spec file , There are download links and usage methods .
- Move SPEC file
mv zookeeper.spec /root/rpmbuild/SPECS/
- Delete the original rpm package
rm -rf zookeeper_3_0_1_0_187-3.4.6.3.0.1.0-187.noarch.rpm
Modify the content
View the contents of the extracted file ,

Modify as needed ,
- If you just need to replace the file with the same name , Then directly replace it ;
- If you need to add files or folders , You need to in
zookeeper.specAdd files or folders in the original format ; - If you need to delete a file or folder , It also needs to be
zookeeper.specDelete the corresponding file or folder . - If there are many modified files , You can also convert the original
%filesChange the content to
%files
%defattr(-,root,root,-)
/usr/hdp/3.0.1.0-187
Call again rpm package
After modifying the document , Repackage into rpm file ,
cd /root/rpmbuild/SPECS
rpmbuild -ba --buildroot /root/rpmbuild/BUILDROOT/ zookeeper.spec

After the execution is completed, the /root/rpmbuild/RPMS View new rpm package

notes : This article was first published on personal blog website : http://www.erik-ly.com/
边栏推荐
- 编程实战赛来啦!B站周边、高级会员等好礼送你啦!
- 【刷题篇】避免洪水泛滥
- More than 20 years after Hong Kong's return, Tupu digital twin Hong Kong Zhuhai Macao Bridge has shocked
- (8) JMeter component detailed once only controller
- Why can't the database table be written into data
- What is erdma as illustrated by Coptic cartoon?
- WTM major updates, multi tenancy and single sign on
- Common UI components
- Basic syntax of unity script (1) - common operations of game objects
- MFQE 2.0: A New Approach for Multi-FrameQuality Enhancement on Compressed Video
猜你喜欢

智慧运维:基于 BIM 技术的可视化管理系统

可观测,才可靠:云上自动化运维CloudOps系列沙龙 第一弹

60 个神级 VS Code 插件!!

Introduction to two types of rxjs observable operators

【刷题篇】爱吃香蕉的珂珂

There is no utf8 option for creating tables in Navicat database.

kaniko官方文档 - Build Images In Kubernetes

App wechat payment unicloud version of uniapp payment (with source code)

Unity Animator 参数

Methodology for troubleshooting problems (applicable to troubleshooting problems arising from any multi-party cooperation)
随机推荐
MFQE 2.0: A New Approach for Multi-FrameQuality Enhancement on Compressed Video
Lucky hash quiz system development (source code deployment) fun investment hash game play development (case requirements)
Mqtt ROS simulates publishing a custom message type
科普达人丨漫画图解什么是eRDMA?
Resource realization applet opening traffic main tutorial
发生QQ大规模盗号事件,暴露出什么网络安全问题?
How can c write an SQL parser
[the path of system analyst] Chapter 5 Software Engineering (Agile Development)
可观测,才可靠:云上自动化运维CloudOps系列沙龙 第一弹
With the development of industrial Internet, the landing and application of the Internet has become wider
Basic syntax of unity script (5) - vector
Basic syntax of unity script (4) - access to other game objects
Basic syntax of unity script (1) - common operations of game objects
【刷题篇】避免洪水泛滥
MySQL如何将列合并?
为基础性语言摇旗呐喊
App wechat payment unicloud version of uniapp payment (with source code)
Wechat applet reports an error: typeerror: cannot read property 'SetData' of undefined
提权扫描工具
SQL programming problem, test case failed