原因:centOS6在2020年12月停止更新了,然后很多地方包括国内的源地址都失效了,此方法是适用于我的,我也找了很久攻略,因为自己懒,然后没记录下来,不小心删了虚拟机,又耗掉我半天,特写此贴。

操作:修改源 使用vim命令进入到
/etc/yum.repos.d/CentOS-Base.repo

以下是我修改后唯一有效的,反正就是找有效的源,可以访问就不会报错

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.  (这行注释的意思就是你mirrolist失效了,可以打开baseurl,但是很可惜 他也失效了 所以改为vault的可以使用)
#
#[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=https://vault.centos.org/6.10/os/$basearch/
#https://vault.centos.org/$releasever/os/$basearch/
gpgcheck=1
gpgkey=https://vault.centos.org/6.10/os/x86_64/RPM-GPG-KEY-CentOS-6
#https://vault.centos.org/centos/RPM-GPG-KEY-CentOS-6#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=https://vault.centos.org/6.10/os/x86_64/
#https://vault.centos.org/$releasever/os/$basearch/
gpgcheck=1
gpgkey=https://vault.centos.org/6.10/os/x86_64/RPM-GPG-KEY-CentOS-6
#https://vault.centos.org/centos/RPM-GPG-KEY-CentOS-6#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=https://vault.centos.org/6.10/extras/$basearch/
#https://vault.centos.org/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=https://vault.centos.org/6.10/os/x86_64/RPM-GPG-KEY-CentOS-6
#https://vault.centos.org/centos/RPM-GPG-KEY-CentOS-6#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=https://vault.centos.org/6.10/contrib/$basearch/
#https://vault.centos.org/$releasever/ccontrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://vault.centos.org/6.10/os/x86_64/RPM-GPG-KEY-CentOS-6
#https://vault.centos.org/centos/RPM-GPG-KEY-CentOS-6#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
baseurl=https://vault.centos.org/6.10/contrib/$basearch/
#https://vault.centos.org/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://vault.centos.org/6.10/os/x86_64/RPM-GPG-KEY-CentOS-6
#https://vault.centos.org/centos/RPM-GPG-KEY-CentOS-6

改完后 按ESC 输入:wq (表示保存并退出) 若你改错了想强制退出不保存 可以输入:q! (也可按u 退回 —>这个不知道是不是通用)
改完后并没有结束,还需要执行以下命令
yum clean all
yum makecache
yum update
(注意 有时候下载失败 有可能不是源失效 可能是你网不好,或者你的虚拟机根本ping不通外网,这种情况只能你自己继续解决相应问题)

虚拟机centOS6 Linux系统关于yum install mirror报错 路径报错相关推荐

  1. linux系统中make install 时指定安装路径

    当我们从github中下载一个开源软件(或者库),通常需要"三连"(./configure && make && make install )安装( ...

  2. centos6 安装 mantisbt-1.2.8 —— (3)Linux系统下yum源配置(Centos 6)

    Linux系统下yum源的配置(阿里云): 1.备份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.ba ...

  3. VMware Fusion for mac虚拟机中Linux系统并使用ssh连接

    VMware Fusion for mac虚拟机中Linux系统并使用ssh连接 前言:本篇讲述在Mac操作系统中,使用VMware Fusion虚拟机安装Linux系统 安装VMware Funct ...

  4. VMware虚拟机的linux系统无法与主机复制粘贴文字以及文件解决办法

    VMware虚拟机的linux系统无法与主机复制粘贴文字以及文件解决办法 Ubuntu只需要输入两行代码: sudo apt-get autoremove open-vm-toolssudo apt- ...

  5. VMwareWorkstation虚拟机安装Linux系统

    VMwareWorkstation虚拟机安装Linux系统 目录 虚拟机简介 安装Linux系统 虚拟机简介 虚拟机是一个软件,它可以使你在一台真实PC机器上同时运行二个或更多window / lin ...

  6. Windows系统安装虚拟机以及Linux系统

    一.为什么要安装虚拟机 许多初学者在直接安装Linux时,即使安装成功了,也很有可能不小心破坏掉现有的 Windows 系统,比如导致硬盘数据丢失.Windows 开机异常等等问题. 但是,如果通过虚 ...

  7. 虚拟机 装服务器系统怎么安装教程,VMware虚拟机安装Linux系统图文教程

    VMware虚拟机安装Linux系统图文教程 发布时间:2020-09-16 21:47:53 来源:脚本之家 阅读:115 作者:我是一名程序猿 栏目:服务器 本文为大家分享了VMware安装Lin ...

  8. VMware虚拟机安装Linux系统手把手菜鸟教程

    VMware虚拟机安装Linux系统手把手菜鸟教程 本文引用https://blog.csdn.net/qq_31323797/article/details/84306233,https://blo ...

  9. 使用虚拟机安装Linux系统常见的错误以及解决方案

    使用虚拟机安装Linux系统常见的错误以及解决方案 参考文章: (1)使用虚拟机安装Linux系统常见的错误以及解决方案 (2)https://www.cnblogs.com/yanjiexiansh ...

最新文章

  1. CVPR 2020 Oral | 旷视研究院提出Circle Loss,革新深度特征学习范式
  2. rsyslog服务日志报错分析1
  3. [HNOI2002]彩票
  4. emwin自定义消息问题
  5. javascript中动态添加事件
  6. XGBoost-Python完全调参指南-参数解释篇
  7. ORACLE初始化参数文件详细文档
  8. 无人机怎么设定航线_收藏!老飞手的航线规划笔记在这里...(上篇)
  9. java 蓝桥杯 算法训练 区间k大数查询(题解)
  10. Hadoop:Hadoop基本命令
  11. Spring设置定时器配置
  12. MySQL中的基本SQL语句
  13. table-首列冻结
  14. 孤军大作战!疯狂DIY 1U硬件防火墙实录(转)
  15. Firefox与chrome 远程调试标签页初体验,顺便解决PC移动端网页因为safe-browsing表现不一致问题。
  16. hansontable编辑器
  17. 程序员必备的5个自媒体工具
  18. 设计模式学习笔记总结
  19. NPDP新产品考试考后感想~
  20. 黄金的18K和24K是什么意思

热门文章

  1. git不显示贡献度的解决方案
  2. flowable 查询完成的流程_flowable流程引擎初体验,完成一个请假流程
  3. 《中国通史 2016》_12_读后感
  4. 中国通史—秦的统一与政策
  5. lumen 框架学习
  6. Vue2官网使用及简介
  7. PoE供电六大常见问题大全解析
  8. mysql 修改数据库字段update_SQL语句update修改数据库字段
  9. 如何计算对数收益率和净值化转换
  10. 电话机器人API接口-空号识别-座席WEBAPI