On linux can we repackage a installed rpm if so how.I remember that the a rpm can be generated from the installed binaries
rpm -??? > my.rpm
Also the later i.e, the newer rpm should work on a different machine
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is possible, but not with the
rpmcommand. I wrote a perl script that does this; it crafts a spec file based on the outputs ofrpm -qand does a “build” which just copies the installed files from the system.You can find it here: https://github.com/cormander/rogue-beret-tools/blob/master/scripts/rpm-repack
Usage example, re-packaging the
mailxrpm:Query it:
Repack it:
Query the newly built package:
The code isn’t at all elegant, but functional. It does copy a lot of the rpm info (everything from
rpm -qiand most of the scripts), but it isn’t by any means comprehensive. Also, it can’t copy the GPG signature, nor will it have the same checksums as the original RPM file.NOTE: This is not a “proper” way to build and distribute RPM packages, and was mainly written for troubleshooting and educational purposes.