yum 软件包管理

YUM(全称为 Yellow dog Updater, Modified)是一个在 Fedora 和 RedHat 以及 SUSE 中的 Shell 前端软件包管理器。

YUM 源定义文件在 /etc/yum.repos.d/ 目录下,文件为 CentOS-Base.repo

CentOS-Base.repo 默认配置信息

[root@hexingxing yum.repos.d]# cat CentOS-Base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

    

命令实例

[root@hexingxing ~]# yum check-update < 软件名>

// 列出一个或多个以及全部可升级的软件包

[root@hexingxing ~]# yum update < 软件名>

// 列出一个或多个以及全部可升级的软件包并执行升级

[root@hexingxing ~]# yum list < 软件名>

// 列出一个或多个以及全部已安装以及可升级的软件包

[root@hexingxing ~]# yum install < 软件名>

// 安装一个或多个软件,-y 选项执行非交互式安装

[root@hexingxing ~]# yum deplist < 软件名>

// 列出一个或多个软件包的依赖关系

[root@hexingxing ~]# yum remove < 软件名>

// 删除一个或多个软件,-y 选项执行非交互式安装

[root@hexingxing ~]# yum search < 软件名>

// 搜索一个或多个 < 软件名> 相关的软件包

[root@hexingxing ~]# yum info < 软件名>

// 列出一个或多个以及全部已安装版本和可升级版本的软件包详细信息

[root@hexingxing ~]# yum clean all

// 清空所有缓存信息

[root@hexingxing ~]# yum history

// 列出操作历史记录

0 条评论

昵称

沙发空缺中,还不快抢~