首先看我的报错
[Errno 14] curl#6 - "Could not resolve host: mirrors.aliyun.com; Unknown error"yum源配置出现了问题
cd /etc/yum.repos.d/
vi local.repo#里面装的是Centos-7.repo Centos-Base.repo
查看内容如下
# CentOS-Base.repo
#
# The mirror system uses the connecting
# update status of each mirror to pick
# geographically close to the client.
# unless you are manually picking other
#
# If the mirrorlist= does not work for
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base - mirror
failovermethod=priority
baseurl=http://mirrors.aliyun.com/cento
http://mirrors.aliyuncs.com/cen
http://mirrors.cloud.aliyuncs.c
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/
就会发现$releasever重复出现多次,导致url地址不正确
验证:
1.复制url地址到浏览器中看是否能够访问
访问不了,说明url地址确实出现了错误
修改url地址
输入 ":" 进入末行模式
然后输入 %s/$releasever/7/g
保存并退出
然后发现有了新的问题
yum clean all
报错
Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Cleaning repos: base etras extras
...: train updates updatess virt
Other repos take up 11 M of disk space (use --verbose for details)
Loaded plugins: fastestmirror
fastestmirror是yum的一个加速插件
这个地方是插件提示信息
意思是插件不能用了。
既然不能用了,那我们就禁用它
1.修改插件的配置文件
vi /etc/yum/pluginconf.d/fastestmirror.conf
enabled = 1//由1改为0,禁用该插件
2.修改yum的配置文件
vi /etc/yum.conf
plugins=1//改为0,不使用插件
3 清除缓存并重新构建yum 源
yum clean all
yum clean dbcache
yum makecache
然后发现仍然yum clean不成功
Repository base is listed more than once in the configuration
说有重复的名称
改名字或者删除
这里我选择删除掉aliyun的yum源
yum clean all
仍然报错
Cleaning repos: base etras train updatess virt
Other repos take up 11 M of disk space (use --verbose for details)
清洁存储库:其他存储库占用 11 M 磁盘空间(有关详细信息,请使用 --verbose)
回溯快照
仍然报错
[root@controller yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Bad id for repo: root@controller yum.repos.d, byte = @ 4
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Cleaning repos: base extras train updates virt
Other repos take up 11 M of disk space (use --verbose for details)
下次再写吧无语了
标签:http,centos,redhat,mirrors,repos,os7,base,yum,com From: https://www.cnblogs.com/humlogs/p/17787440.html