rpm包安装

[root@localhost ~]# rpm -ivh -force MySQL-client-5.1.72-1.glibc23.i386.rpm

[root@localhost ~]# rpm -ivh --force "http://mirrors.sohu.com/mysql/MySQL-5.1/MySQL-client-5.1.72-1.glibc23.i386.rpm"

-i  表示安装

-v  表示显示安装过程信息

-h  表示安装进度

--force  表示强制安装,忽略依存关系


rpm包卸载

[root@localhost ~]# rpm -e --nodeps mysql-libs

-e  表示卸载

--nodeps  表示强制,忽略依存关系


rpm升级

[root@localhost ~]# rpm -Uvh --force MySQL-client-5.1.72-1.glibc23.i386.rpm

[root@localhost ~]# rpm -Uvh --force "http://mirrors.sohu.com/mysql/MySQL-5.1/MySQL-client-5.1.72-1.glibc23.i386.rpm"

-U  表示升级

-v  表示显示安装过程

-h  表示显示安装进度

--force  表示强制升级,忽略依存关系


rpm查询是否已安装

[root@localhost ~]# rpm -qa samba

[root@localhost ~]# rpm -qa | grep samba


rpm包查询详细信息

[root@localhost ~]# rpm -qi samba

Name        : samba                        Relocations: (not relocatable)

Version     : 3.6.23                            Vendor: CentOS

Release     : 20.el6                        Build Date: 2015年07月24日 星期五 11时10分59秒

Install Date: 2015年12月15日 星期二 17时05分55秒      Build Host: c6b8.bsys.dev.centos.org

Group       : System Environment/Daemons    Source RPM: samba-3.6.23-20.el6.src.rpm

Size        : 18428246                         License: GPLv3+ and LGPLv3+

Signature   : RSA/SHA1, 2015年07月25日 星期六 04时43分18秒, Key ID 0946fca2c105b9de

Packager    : CentOS BuildSystem <http://bugs.centos.org>

URL         : http://www.samba.org/

Summary     : Server and Client software to interoperate with Windows machines

Description :


Samba is the suite of programs by which a lot of PC-related machines

share files, printers, and other information (such as lists of

available files and printers). The Windows NT, OS/2, and Linux

operating systems support this natively, and add-on packages can

enable the same thing for DOS, Windows, VMS, UNIX of all kinds, MVS,

and more. This package provides an SMB/CIFS server that can be used to

provide network services to SMB/CIFS clients.

Samba uses NetBIOS over TCP/IP (NetBT) protocols and does NOT

need the NetBEUI (Microsoft Raw NetBIOS frame) protocol.


查询samba包都安装了哪些文件

[root@localhost ~]# rpm -ql samba


查询/bin/ls属于哪个rpm包

[root@localhost ~]# rpm -qf /bin/ls

coreutils-8.4-31.el6.i686