解压RPM包

有时我们需要RPM包中的某个文件,如何解压RPM包呢?

RPM包括是使用cpio格式打包的,因此可以先转成cpio然后解压,如下所示:

rpm2cpio xxx.rpm | cpio -div



例如:

[root@localhost oracle]# rpm2cpio oracle-instantclient11.2-basic-11.2.0.2.0.i386.rpm | cpio -div
./usr/lib/oracle/11.2/client/bin/adrci
./usr/lib/oracle/11.2/client/bin/genezi
./usr/lib/oracle/11.2/client/lib/libclntsh.so.11.1
./usr/lib/oracle/11.2/client/lib/libnnz11.so
./usr/lib/oracle/11.2/client/lib/libocci.so.11.1
./usr/lib/oracle/11.2/client/lib/libociei.so
./usr/lib/oracle/11.2/client/lib/libocijdbc11.so
./usr/lib/oracle/11.2/client/lib/ojdbc5.jar
./usr/lib/oracle/11.2/client/lib/ojdbc6.jar
./usr/lib/oracle/11.2/client/lib/xstreams.jar
336597 块
[root@localhost oracle]# ls

你可能感兴趣的:(linux,rpm)