linux-centos-yum源配置
yum的配置文件路径
- cd /etc/yum.repos.d/
- 填写yum源的唯一ID标识,可以为任意字符串,
- name 是yum源名称,可以为任意字符串,
- baseurl 指定yum源的url地址,
- mirrorlist -->指定镜像站点目录,默认是官网自身的yum源,这个可以注释掉,使用baseurl指定的源(http://mirrors.aliyun.com/repo/Centos-6.repo),
- enabled -->指是否激活YUM源0代表禁用,1代表激活
- gpgcheck -->安装软件时是否检查签名0代表禁用1代表激活
- gpgkey -->如果检查软件包的签名,则该语句代表检查签名的密钥文件
- name 是yum源名称,可以为任意字符串,
name=
baseur=
mirrorlist=
enabled=
gpgcheck=
gpgkey=
# CentOS-Base.repo
#
[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com # 名字
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/ # URL源地址
http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
注意:单个的安装包可能会依赖其它包(例如yum和yum-fastestmirror会相互依赖),所以我们可以把所有这些包放在一起,用一行命令将它们同时安装即可
rpm -ivh python-urlgrabber-3.10-10.el7.noarch.rpm
rpm -ivh yum-*
清除并生成缓存
yum clean all
yum makecache
yum update
本文来自博客园,作者:link-零,转载请注明原文链接:https://www.cnblogs.com/e-link/p/16815026.html❤❤❤