您的位置:首页 > 运维架构 > Linux

linux软件包管理(RPM)简单介绍

2017-03-12 10:53 246 查看
在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 openssh
Name        : openssh
Version     : 6.6.1p1
Release     : 33.el7_3
Architecture: x86_64
Install Date: 2017年01月20日 星期五 23时27分42秒
Group       : Applications/Internet
Size        : 1450186
License     : BSD
Signature   : RSA/SHA256, 2017年01月18日 星期三 20时57分53秒, Key ID 24c6a8a7f4a80eb5
Source RPM  : openssh-6.6.1p1-33.el7_3.src.rpm
Build Date  : 2017年01月18日 星期三 03时19分58秒
Build Host  : c1bm.rdu2.centos.org
Relocations : (not relocatable)
Packager    : CentOS BuildSystem <http://bugs.centos.org>
Vendor      : CentOS
URL         : http://www.openssh.com/portable.html Summary     : An open source implementation of SSH protocol versions 1 and 2
Description :
SSH (Secure SHell) is a program for logging into and executing
commands on a remote machine. SSH is intended to replace rlogin and
rsh, and to provide secure encrypted communications between two
untrusted hosts over an insecure network. X11 connections and
arbitrary TCP/IP ports can also be forwarded over the secure channel.

OpenSSH is OpenBSD's version of the last free version of SSH, bringing
it up to date in terms of security and features.

This package includes the core files necessary for both the OpenSSH
client and server. To make this package useful, you should also
install 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查看。

20170312 by MrBread
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  软件 管理 rpm linux