Tuesday, 29 April 2014

How to extract the RPM package


We can extract the content of RPM package first into cpio archive using utility rpm2cpio on standard output. if a – argument is given using cpio command, an rpm stream is read from standard in. The syntax is as follows.

SYNTAX:

$ rpm2cpio <RPM package> | cpio –idvm

Example:  

[root@syncsrv01 jitendrakumar]# ls -ltr
total 292
-rw-------. 1 jitendrakumar domain admins   1675 Aug 23  2013 ssh_key
-rwxr-xr-x. 1 root          root             879 Nov 26 15:46 root_expir_alert
-rw-r--r--. 1 root          root          290624 Apr 29 15:48 ntfs-3g-2011.4.12- 5.el6.i686.rpm   
                                                                      
[root@syncsrv01 jitendrakumar]# rpm2cpio ntfs-3g-2011.4.12-5.el6.i686.rpm | cpio   -idvm                                                                           
./bin/lowntfs-3g
./bin/ntfs-3g
./bin/ntfs-3g.probe
./bin/ntfs-3g.secaudit
./bin/ntfs-3g.usermap
./bin/ntfsmount
./lib/libntfs-3g.so.81
./lib/libntfs-3g.so.81.0.0
./sbin/mount.lowntfs-3g
./sbin/mount.ntfs
./sbin/mount.ntfs-3g
./sbin/mount.ntfs-fuse
./usr/bin/ntfs-3g
./usr/bin/ntfsmount
./usr/share/doc/ntfs-3g-2011.4.12
./usr/share/doc/ntfs-3g-2011.4.12/AUTHORS
./usr/share/doc/ntfs-3g-2011.4.12/COPYING
./usr/share/doc/ntfs-3g-2011.4.12/CREDITS
./usr/share/doc/ntfs-3g-2011.4.12/ChangeLog
./usr/share/doc/ntfs-3g-2011.4.12/NEWS
./usr/share/doc/ntfs-3g-2011.4.12/README
./usr/share/hal/fdi/policy/10osvendor/20-ntfs-config-write-policy.fdi
./usr/share/man/man8/mount.lowntfs-3g.8.gz
./usr/share/man/man8/mount.ntfs-3g.8.gz
./usr/share/man/man8/ntfs-3g.8.gz
./usr/share/man/man8/ntfs-3g.probe.8.gz
./usr/share/man/man8/ntfs-3g.secaudit.8.gz
./usr/share/man/man8/ntfs-3g.usermap.8.gz
1304 blocks

[root@syncsrv01 jitendrakumar]# ll
total 308
drwxr-xr-x. 2 root          root            4096 Apr 29 15:49 bin
drwxr-xr-x. 2 root          root            4096 Apr 29 15:49 lib
-rw-r--r--. 1 root          root          290624 Apr 29 15:48 ntfs-3g-2011.4.12-5.el6.i686.rpm
-rwxr-xr-x. 1 root          root             879 Nov 26 15:46 root_expir_alert
drwxr-xr-x. 2 root          root            4096 Apr 29 15:49 sbin
-rw-------. 1 jitendrakumar domain admins   1675 Aug 23  2013 ssh_key
drwxr-xr-x. 4 root          root            4096 Apr 29 15:49 usr


The extracted rpm data are

bin lib  sbin user

Note:
In this example, output of rpm2cpio command piped to cpio command with following options:
§  i: Restore archive
§  d: Create leading directories where needed
§  m: Retain previous file modification times when creating files
§  v: Verbose i.e. display progress


5 comments:

  1. Bhai ka karke maanoge.... Humse na ho pawega yo....

    ReplyDelete
  2. Office ki secret info baant rahe ho net pe.

    ReplyDelete
    Replies
    1. There is office document. It is Knowledge share about linux to make Linux world popular.

      Delete
  3. This comment has been removed by the author.

    ReplyDelete