在linux系统中,我们都知道安装软件常会用到rpm包,其实rpm代表的意思是:Redhat Package Manager。
下面我们来简单介绍一下关于rpm包的基本知识和rpm包操作的常用指令。
以apache-1.3.23-11.i386.rpm为例来简单介绍一下命名规则。
其中:
apache:软件名称
1.3.23-11:软件的版本号,主版本号和副版本号
i386:软件所运行的硬件平台,一般i386,i586,x86等都是32位的系统,而x64是64位系统,但是我们也会看到有些包是x86_64,其代表的是64位系统。
.rpm:扩展名
还有我们会看到以下的内容:
fcxx,elx:fc18代表是在fedora 18系统下使用的,e16代表的是REHL6.x(红帽或者CentOS6.x)下使用的.
devel:代表的是软件的开发包
noarch:代表的是在任何平台上都可以运行。
1、查询linux安装的软件包
# rpm -qa
-q代表查询,-a代表所有安装的软件包
也可以查询具体某个软件安装的信息:
[root@markpain ~]# rpm -qi opensshName : opensshVersion: 6.6.1p1Release: 33.el7_3Architecture: x86_64Install Date: 01月20日 星期五 23时27分42秒Group : Applications/InternetSize : 1450186License: BSDSignature : RSA/SHA256, 01月18日 星期三 20时57分53秒, Key ID 24c6a8a7f4a80eb5Source RPM : openssh-6.6.1p1-33.el7_3.src.rpmBuild Date : 01月18日 星期三 03时19分58秒Build Host : c1bm.Relocations : (not relocatable)Packager : CentOS BuildSystem <>Vendor: CentOSURL : /portable.htmlSummary: An open source implementation of SSH protocol versions 1 and 2Description :SSH (Secure SHell) is a program for logging into and executingcommands on a remote machine. SSH is intended to replace rlogin andrsh, and to provide secure encrypted communications between twountrusted hosts over an insecure network. X11 connections andarbitrary TCP/IP ports can also be forwarded over the secure channel.OpenSSH is OpenBSD's version of the last free version of SSH, bringingit up to date in terms of security and features.This package includes the core files necessary for both the OpenSSHclient and server. To make this package useful, you should alsoinstall openssh-clients, openssh-server, or both.
2、安装RPM包
一般格式为:
rpm -i 软件包全路径名称
执行指令之后即可将该安装包安装到系统之中。
如果需要查看详细的安装信息可以使用以下参数:
-v =verbose:输出提示
-h =hash:显示安装进度条
3、删除RPM包
rpm -e 包名称
我们知道有些包是和其他包有依赖关系的,所以我们使用上面参数有时会提示错误,依赖关系检测说被其他包需要。这时如果我们要强行删除需要加上:
–nodeps
4、升级RPM包
格式为:
rpm -U RPM包全路径名
其他详细参数可以使用man rpm查看。
0312 by MrBread