查看软件的信息和 changelog
[root@liqiang.io]# rpm -qi --changelog iputils | head -30
Name : iputils
Version : 20160308
Release : 10.el7
Architecture: x86_64
Install Date: Sun 05 May 2019 07:14:24 PM CST
Group : System Environment/Daemons
Size : 343497
License : BSD and GPLv2+
Signature : RSA/SHA256, Fri 11 Aug 2017 12:47:33 AM CST, Key ID 24c6a8a7f4a80eb5
Source RPM : iputils-20160308-10.el7.src.rpm
Build Date : Fri 04 Aug 2017 04:01:04 PM CST
Build Host : c1bm.rdu2.centos.org
Relocations : (not relocatable)
Packager : CentOS BuildSystem <http://bugs.centos.org>
Vendor : CentOS
URL : https://github.com/iputils/iputils
Summary : Network monitoring tools including ping
Description :
The iputils package contains basic utilities for monitoring a network,
including ping. The ping command sends a series of ICMP protocol
ECHO_REQUEST packets to a specified network host to discover whether
the target machine is alive and receiving network traffic.
* Mon May 22 2017 Jan Synáček <jsynacek@redhat.com> - 20160308-10
- fix pmtu discovery for ipv6 (#1444281)
* Tue Feb 21 2017 Jan Synáček <jsynacek@redhat.com> - 20160308-9
- IPv4 vs IPv6 inconsistency on return value of ping (#1362388)
- ping6 does not use device specified with -I parameter (#1371824, #1424965)
- double cap_free call in ping_common.c (#1410114)
- ping assumes EACCESS errors are due to broadcast addresses (#1387315)
不安装 RPM 查看 RPM 的信息
[root@liqiang.io]# rpm -qpi --changelog /root/a-very-important-packgage.rpm
- 其实就是
-p
参数
安装 RPM
[root@liqiang.io]# rpm -i /root/a-very-important-packgage.rpm
[root@liqiang.io]# yum install -y /root/a-very-important-packgage.rpm
- 使用
rpm
命令安装不会安装依赖的其他包 - 使用
yum
安装可以自动安装依赖的包
升级 RPM
[root@liqiang.io]# rpm -Uvh /root/a-very-important-packgage.rpm
[root@liqiang.io]# rpm -Uvh --force /root/a-very-important-packgage.rpm
- 第二个加上了
--force
参数,这个在开发时会很有用
查看 RPM 安装后的文件
[root@liqiang.io]# rpm -ql iputils
/etc/sysconfig/rdisc
/usr/bin/ping
/usr/bin/ping6
/usr/bin/tracepath
/usr/bin/tracepath6
/usr/lib/systemd/system/rdisc.service
/usr/sbin/arping
/usr/sbin/clockdiff
/usr/sbin/ifenslave
/usr/sbin/ping6
/usr/sbin/rdisc
/usr/sbin/tracepath
/usr/sbin/tracepath6
/usr/share/doc/iputils-20160308
/usr/share/doc/iputils-20160308/README.bonding
/usr/share/doc/iputils-20160308/RELNOTES
/usr/share/man/man8/arping.8.gz
/usr/share/man/man8/clockdiff.8.gz
/usr/share/man/man8/ifenslave.8.gz
/usr/share/man/man8/ping.8.gz
/usr/share/man/man8/ping6.8.gz
/usr/share/man/man8/rdisc.8.gz
/usr/share/man/man8/tracepath.8.gz
/usr/share/man/man8/tracepath6.8.gz
卸载 RPM
[root@liqiang.io]# rpm -e a-very-important-packgage
查看一个文件是哪个 RPM 安装的
[root@liqiang.io]# rpm -qf /usr/bin/ping
iputils-20160308-10.el7.x86_64
解压 RPM
不安装获取 RPM 内的文件
[root@liqiang.io]# rpm2cpio ./packagecloud-test-1.1-1.x86_64.rpm | cpio --extract --make-directories