22 Jul 2008

Extracting files from rpm and deb packages 

By - Linux, Quick Tip No Comments

We ran into an issue where an init script was missing and we needed to restore the file.  The backup (of course) did not include the file we needed.  We had to download the package, extract the contents, and move the init script back into place.  Below are the commands used:

DEB:

$ dpkg-deb -x <package.deb> /restore/dir

RPM:

$ rpm2cpio <package.rpm> | cpio -idv

No Responses to “Extracting files from rpm and deb packages”

Leave a Reply