CentOS Linux 下不安装 rpm 包查看其里面的内容
文章
林里克斯
实验平台:
CentOS Linux release 7.6.1810
rpm 包:
mysql-community-client-5.7.10-1.el7.x86_64.rpm
1.查看 rpm
里有那些文件
rpm2cpio
$ rpm2cpio mysql-community-client-5.7.10-1.el7.x86_64.rpm |cpio -t
./usr/bin/mysql
./usr/bin/mysql_config
./usr/bin/mysql_config-64
./usr/bin/mysql_config_editor
./usr/bin/mysqladmin
./usr/bin/mysqlbinlog
./usr/bin/mysqlcheck
./usr/bin/mysqldump
./usr/bin/mysqlimport
./usr/bin/mysqlpump
./usr/bin/mysqlshow
./usr/bin/mysqlslap
./usr/share/doc/mysql-community-client-5.7.10
./usr/share/doc/mysql-community-client-5.7.10/COPYING
./usr/share/doc/mysql-community-client-5.7.10/README
./usr/share/man/man1/mysql.1.gz
./usr/share/man/man1/mysql_config_editor.1.gz
./usr/share/man/man1/mysqladmin.1.gz
./usr/share/man/man1/mysqlbinlog.1.gz
./usr/share/man/man1/mysqlcheck.1.gz
./usr/share/man/man1/mysqldump.1.gz
./usr/share/man/man1/mysqlimport.1.gz
./usr/share/man/man1/mysqlpump.1.gz
./usr/share/man/man1/mysqlshow.1.gz
./usr/share/man/man1/mysqlslap.1.gz
222783 blocks
rpm
$ rpm -qlp mysql-community-client-5.7.10-1.el7.x86_64.rpm
warning: mysql-community-client-5.7.10-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
/usr/bin/mysql
/usr/bin/mysql_config
/usr/bin/mysql_config-64
/usr/bin/mysql_config_editor
/usr/bin/mysqladmin
/usr/bin/mysqlbinlog
/usr/bin/mysqlcheck
/usr/bin/mysqldump
/usr/bin/mysqlimport
/usr/bin/mysqlpump
/usr/bin/mysqlshow
/usr/bin/mysqlslap
/usr/share/doc/mysql-community-client-5.7.10
/usr/share/doc/mysql-community-client-5.7.10/COPYING
/usr/share/doc/mysql-community-client-5.7.10/README
/usr/share/man/man1/mysql.1.gz
/usr/share/man/man1/mysql_config_editor.1.gz
/usr/share/man/man1/mysqladmin.1.gz
/usr/share/man/man1/mysqlbinlog.1.gz
/usr/share/man/man1/mysqlcheck.1.gz
/usr/share/man/man1/mysqldump.1.gz
/usr/share/man/man1/mysqlimport.1.gz
/usr/share/man/man1/mysqlpump.1.gz
/usr/share/man/man1/mysqlshow.1.gz
/usr/share/man/man1/mysqlslap.1.gz
2.提取 rpm
包里的文件
$ rpm2cpio mysql-community-client-5.7.10-1.el7.x86_64.rpm | cpio -idmv
#会提取到当前目录下,可以看到会多了一个 usr/ 目录,同前面查看包里的内容一致
$ tree usr/
usr/
├── bin
│ ├── mysql
│ ├── mysqladmin
│ ├── mysqlbinlog
│ ├── mysqlcheck
│ ├── mysql_config
│ ├── mysql_config-64
│ ├── mysql_config_editor
│ ├── mysqldump
│ ├── mysqlimport
│ ├── mysqlpump
│ ├── mysqlshow
│ └── mysqlslap
└── share
├── doc
│ └── mysql-community-client-5.7.10
│ ├── COPYING
│ └── README
└── man
└── man1
├── mysql.1.gz
├── mysqladmin.1.gz
├── mysqlbinlog.1.gz
├── mysqlcheck.1.gz
├── mysql_config_editor.1.gz
├── mysqldump.1.gz
├── mysqlimport.1.gz
├── mysqlpump.1.gz
├── mysqlshow.1.gz
└── mysqlslap.1.gz
6 directories, 24 files
与 -idmv
参数一致,不会输出提取文件列表,相当于静默输出
$ rpm2cpio mysql-community-client-5.7.10-1.el7.x86_64.rpm | cpio --extract --make-directories
或者使用
$ rpm2cpio mysql-community-client-5.7.10-1.el7.x86_64.rpm > mysql.cpio
$ cpio -i --make-directories < mysql.cpio
所得到的结果都是一样,都是将 rpm
包里的文件提取出来,过程略微不同
Over~
版权协议须知!
本篇文章来源于 Uambiguous ,如本文章侵犯到任何版权问题,请立即告知本站,本站将及时予与删除并致以最深的歉意
1467 0 2020-12-18
博主卡片
运维时间
搭建这个平台,只为分享及记载自己所遇之事和难题。
现在时间 2025-01-18
今日天气
站点统计
- 文章总数:241篇
- 分类总数:29个
- 评论总数:14条
- 本站总访问量 365530 次
@svmuvwpuqi 真棒!
@smdxydrauu 博主太厉害了!
@xiaozi 最后的分享的镜像下载地址打不开 服务器没有开机吗?
@yuanyuan 为什么我的4b安装centos7.9 插上tf卡 显示不兼...
@Wong arrhenius 牛比
@MakerFace 厉害了!
@TongSir 老哥 更新下我的友链链接 https://blog.ton...