从rpm包中解压文件

从rpm包中解压文件  

2011-08-16 22:34:28|  分类: rpm 包制作 |举报 |字号 订阅

从rpm包中解压文件

- Listing the files in a package file

    # rpm2cpio <RPM Package File>.rpm  | cpio -t
    
In this example, we used the -t option to direct cpio to produce
a "table of contents" of the archive created by rpm2cpio.
This can make it much easier to get the right filename
and path when you want to extract a file.

[root@ealldb2 ttt]# rpm2cpio  vsftpd-1.2.1-3E.6.i386.rpm  |cpio -t
./etc/logrotate.d/vsftpd.log
./etc/pam.d/vsftpd
./etc/rc.d/init.d/vsftpd
./etc/vsftpd
./etc/vsftpd.ftpusers
./etc/vsftpd.user_list
./etc/vsftpd/vsftpd.conf
./usr/sbin/vsftpd
./usr/share/doc/vsftpd-1.2.1
./usr/share/doc/vsftpd-1.2.1/AUDIT
./usr/share/doc/vsftpd-1.2.1/BUGS
./usr/share/doc/vsftpd-1.2.1/Changelog
./usr/share/doc/vsftpd-1.2.1/FAQ
./usr/share/doc/vsftpd-1.2.1/INSTALL
./usr/share/doc/vsftpd-1.2.1/LICENSE
./usr/share/doc/vsftpd-1.2.1/README
./usr/share/doc/vsftpd-1.2.1/README.security
./usr/share/doc/vsftpd-1.2.1/REWARD
./usr/share/doc/vsftpd-1.2.1/SECURITY
./usr/share/doc/vsftpd-1.2.1/SECURITY/DESIGN
./usr/share/doc/vsftpd-1.2.1/SECURITY/IMPLEMENTATION
./usr/share/doc/vsftpd-1.2.1/SECURITY/OVERVIEW
./usr/share/doc/vsftpd-1.2.1/SECURITY/TRUST
./usr/share/doc/vsftpd-1.2.1/SIZE
./usr/share/doc/vsftpd-1.2.1/SPEED
./usr/share/doc/vsftpd-1.2.1/TODO
./usr/share/doc/vsftpd-1.2.1/TUNING
./usr/share/doc/vsftpd-1.2.1/vsftpd.xinetd
./usr/share/man/man5/vsftpd.conf.5.gz
./usr/share/man/man8/vsftpd.8.gz
./var/ftp
./var/ftp/pub
379 blocks
[root@ealldb2 ttt]#


- Extracting one or more files from a package file

    # rpm2cpio  vsftpd-1.2.1-3E.6.i386.rpm  |cpio -ivd ./etc/vsftpd/vsftpd.conf
    
In this case, the cpio options -i, -v, and -d direct cpio to:
    - Extract one or more files from an archive.
    - Display the names of any files processed,
        along with the size of the archive file, in 512-byte blocks. [1]
    - Create any directories that precede the filename specified in the cpio command.


解出一个和全部文件的例子
[root@ealldb2 ttt]# rpm2cpio  vsftpd-1.2.1-3E.6.i386.rpm  |cpio -ivd ./etc/vsftpd/vsftpd.conf
./etc/vsftpd/vsftpd.conf
379 blocks

[root@ealldb2 ttt]# rpm2cpio   vsftpd-1.2.1-3E.6.i386.rpm |cpio -ivd
./etc/logrotate.d/vsftpd.log
./etc/pam.d/vsftpd
./etc/rc.d/init.d/vsftpd
./etc/vsftpd
./etc/vsftpd.ftpusers
./etc/vsftpd.user_list
./etc/vsftpd/vsftpd.conf
./usr/sbin/vsftpd
./usr/share/doc/vsftpd-1.2.1
./usr/share/doc/vsftpd-1.2.1/AUDIT
./usr/share/doc/vsftpd-1.2.1/BUGS
./usr/share/doc/vsftpd-1.2.1/Changelog
./usr/share/doc/vsftpd-1.2.1/FAQ
./usr/share/doc/vsftpd-1.2.1/INSTALL
./usr/share/doc/vsftpd-1.2.1/LICENSE
./usr/share/doc/vsftpd-1.2.1/README
./usr/share/doc/vsftpd-1.2.1/README.security
./usr/share/doc/vsftpd-1.2.1/REWARD
./usr/share/doc/vsftpd-1.2.1/SECURITY
./usr/share/doc/vsftpd-1.2.1/SECURITY/DESIGN
./usr/share/doc/vsftpd-1.2.1/SECURITY/IMPLEMENTATION
./usr/share/doc/vsftpd-1.2.1/SECURITY/OVERVIEW
./usr/share/doc/vsftpd-1.2.1/SECURITY/TRUST
./usr/share/doc/vsftpd-1.2.1/SIZE
./usr/share/doc/vsftpd-1.2.1/SPEED
./usr/share/doc/vsftpd-1.2.1/TODO
./usr/share/doc/vsftpd-1.2.1/TUNING
./usr/share/doc/vsftpd-1.2.1/vsftpd.xinetd
./usr/share/man/man5/vsftpd.conf.5.gz
./usr/share/man/man8/vsftpd.8.gz
./var/ftp
./var/ftp/pub
379 blocks
[root@ealldb2 ttt]#

在 rhel6下 新增加了 rpmdev*

# rpmdev-extract      *.rpm
从rpm包中解压文件 - zhuzhu - 五事九思  (大连Linux主机维护)

三、fedora-rpmdevtools 包含工具;
fedora-buildrpmtree Create RPM build tree within user's home directory
fedora-installdevkeys Install GPG keys in alternate RPM keyring
fedora-kmodhelper Helper script for building kernel module RPMs
fedora-md5 Display the md5sum of all files in an RPM
fedora-newrpmspec Creates new .spec from template
fedora-rmdevelrpms Find (and optionally remove) "development" RPMs
fedora-rpmchecksig Check package signatures using alternate RPM keyring
fedora-rpminfo Prints information about executables and libraries
fedora-rpmvercmp RPM version comparison checker
fedora-extract Extract various archives, "tar xvf" style
fedora-diffarchive Diff contents of two archives
fedora-wipebuildtree Erase all files within dirs created by buildrpmtree
spectool Expand and download sources and patches in specfiles
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值