如果想解压*.src.rpm格式的包,可以执行rpm2cpio命令。
下面这个示例就是解压keystone的源码包:
如下所示,有个*.src.rpm文件:
[root@localhost liusu]# ll
total 1164
-rw-r--r-- 1 root root 1188824 Nov 15 09:42 openstack-keystone-9.0.0-1.el7.src.rpm
执行rpm2cpio命令来解压:
[root@localhost liusu]# rpm2cpio openstack-keystone-9.0.0-1.el7.src.rpm |cpio -iv
keystone-9.0.0.tar.gz
keystone-dist.conf
openstack-keystone-sample-data
openstack-keystone.logrotate
openstack-keystone.service
openstack-keystone.spec
openstack-keystone.sysctl
2331 blocks
如下所示,加压后得文件列表:
[root@localhost liusu]# ll
total 2352
-rw-rw-r-- 1 root root 1181342 Nov 15 09:43 keystone-9.0.0.tar.gz
-rw-rw-r-- 1 root root 263 Nov 15 09:43 keystone-dist.conf
-rw-r--r-- 1 root root 1188824 Nov 15 09:42 openstack-keystone-9.0.0-1.el7.src.rpm
-rw-rw-r-- 1 root root 96 Nov 15 09:43 openstack-keystone.logrotate
-rwxrwxr-x 1 root root 53 Nov 15 09:43 openstack-keystone-sample-data
-rw-rw-r-- 1 root root 242 Nov 15 09:43 openstack-keystone.service
-rw-rw-r-- 1 root root 10122 Nov 15 09:43 openstack-keystone.spec
-rw-rw-r-- 1 root root 201 Nov 15 09:43 openstack-keystone.sysctl