0

How can I add a file into an already existing rpm package?

Is there a way to extract the rpm and add the file and rebuild the package containing the new file?

Vombat
  • 1,156
  • 1
  • 15
  • 27

1 Answers1

0

You can use the rpm2cpio and cpio commands to extract the content of an RPM. This will not create the spec file so you will need to find a copy, or create one.

Forrest
  • 1,370
  • 9
  • 20
  • 1
    That would only extract, not allow a rebuild... and BTW the command specifically is `rpm2cpio rpmfile.rpm | cpio -div` – Aaron D. Marasco Jan 18 '13 at 21:38
  • @Aaron, that is indeed the correct command, however I figured a bit of research might have helped to explain the process better for AmKh. While true this would not rebuild the RPM, there's nothing keeping you from extracting the contents of the RPM, rewriting the spec file, and then building the RPM. you can even install the original RPM to determine file locations and ownership. It's not a pretty process but it is an option when the complexity of the RPM isn't too intense. – Forrest Jan 18 '13 at 22:41