Extract files from an RPM package

Posted In System - By Tum. On Saturday, October 13th, 2007 With 0 Comments

RPM (Red Hat Package Management) เป็นไฟล์ install ของทาง linux สาย Red Hat ซึ่ง RPM ได้รับความนิยมอย่างสูงเนื่องจากง่ายต่อการติดตั้งและถอดถอนโปรแกรม และ RPM นั้นเป็นไฟล์ archives ที่เก็บ files, scripts, และ special metadata (packages’s dependencies และ changelogs) ดังนั้นถ้าต้องการจะนำไฟล์บางส่วนที่อยู่ใน RPM Package นั้นเราสามารถทำตามขั้นตอนดังข้างล่างนี้ได้เลย

ขั้นตอนการแตกไฟล์ RPM
1. ไปยังที่ directory ที่ไฟล์ rpm นั้นๆอยู่
2. สร้าง directory ใหม่เพื่อใช้ในการเก็บไฟล์ที่แตกออกมา และให้เข้าไปที่ directory ที่สร้างใหม่
3. ใช้คำสั่ง rpm2cpio และ cpio เพื่อทำการแตกไฟล์

[user@linux ~]$ cd ~/downloads
[user@linux downloads]$ ls openmotif*
openmotif-2.3.0-0.3.el5.i386.rpm
[user@linux downloads]$ mkdir openmotif
[user@linux downloads]$ cd openmotif
[user@linux openmotif]$ rpm2cpio ../openmotif-2.3.0-0.3.el5.i386.rpm | cpio -cidv
[…]
./etc/X11/mwm/system.mwmrc
./etc/X11/xinit/xinitrc.d/xmbind.sh
./usr/bin/mwm
./usr/bin/xmbind
./usr/include/X11/bitmaps/xm_error
./usr/include/X11/bitmaps/xm_hour16
./usr/include/X11/bitmaps/xm_hour16m
./usr/include/X11/bitmaps/xm_hour32
./usr/include/X11/bitmaps/xm_hour32m
[…]

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

*