修改Cenos6.8 YumRepo Error: All mirror URLs are not using ftp, http[s] or file,修改yum源后404 Not Found

1.vim /etc/yum/pluginconf.d/fastestmirror.conf

将enable=1改为0
[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.YUM源进行配置
vim /etc/yum.conf

plugins=0 ////由 1 改成0不使用插件

使用上诉方法无效后

备份配置文件,防止以后出错后不好恢复

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

执行下面命令,新建CentOS-Base.repo配置:

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

保存后退出
执行yum list 正常无报错

参考:
https://www.cnblogs.com/88223100/p/yum_Loaded_plugins_fastestmirror.html
https://www.cnblogs.com/pistachio123/p/14301949.html

 

posted @ 2021-08-17 15:14  Yzzzzzzzzz  阅读(21)  评论(0编辑  收藏  举报