rpm命令安装命令
转载自:https://blog.csdn.net/u012149181/article/details/119644062
==========
1、安装软件的命令格式
rpm -ivh filename.rpm
[root@CENTOS100 z08784]# rpm -ivh hdparm-9.43-5.el7.x86_64.rpm
warning: hdparm-9.43-5.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing... ############[1)00%0%) (100%)
agp9.el_6 ay a
2、卸载软件的命令格式
rpm -e filename.rpm
[root@CENTOS100 z08784]# rpm -e hdparm-9.43-5.el7.x86_64.rpm
error: package hdparm-9.43-5.el7.x86_64.rpm is not installed
3、升级软件的命令格式
rpm -Uvh filename.rpm
[root@CENTOS100 z08784]# rpm -Uvh hdparm-9.43-5.el7.x86_64.rpm
warning: hdparm-9.43-5.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
kapa.4.e_s dyt ###############[])1 (100%)
[root@C1087
4、查询软件描述信息的命令格式
rpm -qpi filename.rpm
[root@CENTOS100 z08784]# rpm -qpi hdparm-9.43-5.el7.x86_64.rpm
warning: hdparm-9.43-5.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Name : hdparm
Version : 9.43
Release : 5.el7
Architecture: x86_64
Install Date: (not installed)
Group : Applications/System
Size : 155231
License : BSD
Signature : RSA/SHA256, Fri 04 Jul 2014 09:53:57 AM CST, Key ID 24c6a8a7f4a80eb5
Source RPM : hdparm-9.43-5.el7.src.rpm
Build Date : Tue 10 Jun 2014 01:35:02 PM CST
Build Host : worker1.bsys.centos.org
Relocations : (not relocatable)
Packager : CentOS BuildSystem <http://bugs.centos.org>
Vendor : CentOS
URL : http://sourceforge.net/projects/hdparm/
Summary : A utility for displaying and/or setting hard disk parameters
Description :
Hdparm is a useful system utility for setting (E)IDE hard drive
parameters. For example, hdparm can be used to tweak hard drive
performance and to spin down hard drives for power conservation.
5、列出软件文件信息的命令格式
rpm -qpl filename.rpm
[root@CENTOS100 z08784]# rpm -qpl hdparm-9.43-5.el7.x86_64.rpm
warning: hdparm-9.43-5.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
/sbin/hdparm
/usr/share/doc/hdparm-9.43
/usr/share/doc/hdparm-9.43/Changelog
/usr/share/doc/hdparm-9.43/LICENSE.TXT
/usr/share/doc/hdparm-9.43/README.acoustic
/usr/share/doc/hdparm-9.43/TODO
/usr/share/doc/hdparm-9.43/hdparm.lsm
/usr/share/man/man8/hdparm.8.gz
6、查询文件属于哪个RPM的命令格式
rpm -qf filename.rpm
[root@CENTOS100 z08784]# rpm -qf hdparm-9.43-5.el7.x86_64.rpm
file /home/z08784/hdparm-9.43-5.el7.x86_64.rpm is not owned by any package
[root@CENTOS100 z08784]#