YUM学习

YUM是RPM的增强版,支持package的依赖性。
YUM的配置文件为/etc/yum.repos.d下的.repo文件和/etc/yum.conf

大部分的yum命令和rpm相似,例如:
yum install = rpm -i
yum remove = rpm -e

在Oracle Public Cloud上的yum repository为http://public-yum.oracle.com

[opc@f1062f yum.repos.d]$ yum list |wc -l
7648
[opc@f1062f yum.repos.d]$ yum list installed |wc -l
244

查询文件属于哪个package可以用rpm -qf或yum provides. 下例查询knife属于chef的那个包:

$ rpm -qf `which knife`
file /usr/bin/knife is not owned by any package
$ which knife
/usr/bin/knife
$ ls -l $(which knife)
lrwxrwxrwx 1 root root 21 Jul  8 07:47 /usr/bin/knife -> /opt/chefdk/bin/knife
[opc@f1062f etc]$  rpm -qf /opt/chefdk/bin/knife
chefdk-2.0.26-1.el6.x86_64
$ yum provides /opt/chefdk/bin/knife
Loaded plugins: security
chefdk-2.0.26-1.el6.x86_64 : The full stack of chefdk
Repo        : installed
Matched from:
Other       : Provides-match: /opt/chefdk/bin/knife

可以看到,knife属于chefdk,也就是此命令应位于chef的workstation上,用以与chef server沟通

参考

Learn Linux, 101: RPM and YUM package management
8.5. Configuring Yum and Yum Repositories
15 Linux Yum Command Examples – Install, Uninstall, Update Packages
学习 Linux,101: RPM 和 YUM 包管理——添加新软件并及时更新系统|Linux.中国-开源社区
http://people.redhat.com/bbreard/presos/RHEL_101.pdf
https://en.wikipedia.org/wiki/Yum_(.rpm)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值