Combine Rpm,rpm2cpio,cpio to extract specific files for RPM packages

Source: Internet
Author: User
Original works, allow reprint, reprint, please be sure to hyperlink form to indicate the original source of the article, author information and this statement. Otherwise, legal liability will be held. http://snailwarrior.blog.51cto.com/680306/145588 keep It useful yesterday accidentally put/etc/mail/   SENDMAIL.MC modified, and did not back up the original file, and then thought of the RPM package from the extraction. First, determine which RPM package/ETC/MAIL/SENDMAIL.MC belongs to:
[Root@pps tmp]# RPM-QF/ETC/MAIL/SENDMAIL.MC
Sendmail-8.13.8-2.el5 then extracts the sendmail-8.13.8-2.el5.i386.rpm (or otherwise) from the ISO installation CD and confirms the SENDMAIL.MC path:
[Root@pps tmp]# RPM-QLP sendmail-8.13.8-2.el5.i386.rpm | grep SENDMAIL.MC
Warning:sendmail-8.13.8-2.el5.i386.rpm:header V3 DSA Signature:nokey, key ID 37017186
/ETC/MAIL/SENDMAIL.MC before extracting SENDMAIL.MC, it is necessary to confirm its relative path:
[Root@pps tmp]# Rpm2cpio sendmail-8.13.8-2.el5.i386.rpm | cpio-t | grep SENDMAIL.MC
2570 Blocks
/ETC/MAIL/SENDMAIL.MC good, now can be relieved to extract SENDMAIL.MC:
[Root@pps tmp]# Rpm2cpio sendmail-8.13.8-2.el5.i386.rpm | Cpio-idv./ETC/MAIL/SENDMAIL.MC
./ETC/MAIL/SENDMAIL.MC
2570 blocks "Note" The file path "./etc/mail/sendmail.mc" after the Cpio parameter must be the same as the relative path of the previous query, otherwise the fetch is unsuccessful. Cpio parameter Description:
-t the meaning listed, and "--list" equals, note that at this time, the list is "relative path"
-I the meaning of the extraction, and "--extract" equivalent
-D build directory, and "--make-directories" equivalent
-V redundant information output, and "--verbose" equivalent rpm parameter description:
-Q--query Query-l--list List-F--file specified file-p--package specified RPM package

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.