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)