YUM攻略
1 概述
yum命令 是在Fedora和RedHat以及SUSE中基于 rpm 的软件包管理器,它可以使系统管理人员交互和自动化地更细与管理RPM软件包,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软体包,无须繁琐地一次次下载、安装。
yum提供了查找、安装、删除某一个、一组甚至全部软件包的命令,而且命令简洁而又好记。
2 配置
搭建yum服务器用的不多,这里略过。
主要讲解客户端的配置,这里配置centos官网给出的源, 主要是齐总的baseurl , gpgkey也要适当的改变。
[root@sera yum.repos.d]# pwd
/etc/yum.repos.d
[root@sera yum.repos.d]# sed -n '64,69p' CentOS-Base.repo
[centos-office]
name=centos-office
failovermethod=priority
baseurl=http://mirror.centos.org/centos/6/os/x86_64/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6
[root@sera yum.repos.d]#
使用
【 1 】 R epo 显示仓库列表
[root@sera]# yum --disablerepo=\* --enablerepo=centos-office repolist
已加载插件: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
仓库标识 仓库名称 状态
centos-office centos-office 6,713
repolist: 6,713
【 2 】 list 显示仓库所有程序包
yum --disablerepo=\* --enablerepo=centos-office list
【 3 】 install 程序安装
yum --disablerepo=\* --enablerepo=centos-office instll xxx
参考文献:
https://www.jb51.net/article/33509.htm sed的使用
https://www.cnblogs.com/beyang/p/8352587.html yum常用命令
http://www.firefoxbug.com/index.php/archives/2777/ yum原理
https://www.centos.org/ centos官网
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29194724/viewspace-2214011/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29194724/viewspace-2214011/