1、CentOS都不出新版本了,更不用说Centos6了,但是还是有些情况用到Centos6。由于CentOS6已经在2020年11月30日停止维护了。centos官方停止了对centos6的所有更新,并且下架了包括官方所有的centos6源,所以会导致一些安装失败。
2、yum 出现 Loaded plugins: fastestmirror
见文章:https://blog.csdn.net/wang_magento/article/details/93205584
2.1.修改插件配置文件
# vim /etc/yum/pluginconf.d/fastestmirror.conf
[main]
enabled=0 //由 1 改成0 ,禁用该插件
verbose=0
always_print_best_host = true
socket_timeout=3
# Relative paths are relative to the cachedir (and so works for users as well
# as root).
hostfilepath=timedhosts.txt
maxhostfileage=10
maxthreads=15
#exclude=.gov, facebook
#include_only=.nl,.de,.uk,.ie
2.2.修改yum 配置文件
# vim /etc/yum.conf
9 plugins=0 //不使用插件
2.3.清除缓存并重新构建yum 源
# yum clean all
# yum makecache
3.CentOS6 yum命令报错YumRepo Error:
备份配置文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
新建配置
vim /etc/yum.repos.d/CentOS-Base.repo
将以下代码复制进去
[centos-office]
name=centos-office
failovermethod=priority
baseurl=https://vault.centos.org/6.10/os/x86_64/
gpgcheck=1
gpgkey=https://vault.centos.org/6.10/os/x86_64/RPM-GPG-KEY-CentOS-6
保存之后,搞定。