yum
CentOS: yum, dnf
YUM: Yellowdog Update Modifier,rpm的前端程序,可解决软件包相关依赖性,可在多个库之间定位软件包,up2date的替代工具
- yum repository: yum repo,存储了众多rpm包,以及包的相关的元数据文件(放置于特定目录repodata下)
- 文件服务器:
- http://
- https://
- ftp://
- file://
yum配置文件
yum客户端配置文件:
- /etc/yum.conf:为所有仓库提供公共配置
- /etc/yum.repos.d/*.repo:为仓库的指向提供配置
- 仓库指向的定义:
- [repositoryID]
- name=Some name for this repository
- baseurl=url://path/to/repository/
- enabled={1|0}
- gpgcheck={1|0}
- gpgkey=URL
- enablegroups={1|0}
- failovermethod={roundrobin|priority}
- roundrobin:意为随机挑选,默认值
- priority:按顺序访问
- cost= 默认为1000
yum仓库
yum的repo配置文件中可用的变量:
- $releasever: 当前OS的发行版的主版本号
- $arch: 平台,i386,i486,i586,x86_64等
- $basearch:基础平台;i386, x86_64
- $YUM0-$YUM9:自定义变量
示例:
- http://server/centos/$releasever/$basearch/
- http://server/centos/7/x86_64
- http://server/centos/6/i386
yum源
阿里云repo文件:
CentOS系统的yum源:
- 阿里云:https://mirrors.aliyun.com/centos/$releasever/os/x86_64/
- 清华大学:https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/x86_64/
EPEL的yum源:
阿里巴巴开源软件:
yum-config-manager
- 生成172.16.0.1_cobbler_ks_mirror_CentOS-X-x86_64_.repo
yum-config-manager --add-repo= http://17