• CentOS 6的服务器后执行yum后发现出现Error: Cannot find a valid baseurl for repo: base解决办法


    原因是CentOS 6已经随着2020年11月的结束进入了EOL(Reaches End of Life),官方便在12月2日正式将CentOS 6相关的软件源移出了官方源,随之而来逐级镜像也会陆续将其删除。

    不过有一些老设备依然需要维持在当前系统,CentOS官方也给这些还不想把CentOS 6扔进垃圾堆的用户保留了各个版本软件源的镜像,只是这个软件源不会再有更新了。

    CentOS官方Vault源:http://vault.centos.org/

    首先把fastestmirror关了,这个插件默认会寻找离你最近的镜像站去访问:

    vi /etc/yum/pluginconf.d/fastestmirror.conf

    修改这个参数enable=0

    备份CentOS6系统源

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

    将下面的内容复制进去 vi /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.
    #
    #
     
    [base]
    name=CentOS-6.9 - Base - vault.centos.org
    failovermethod=priority
    baseurl=http://vault.centos.org/6.9/os/$basearch/
    gpgcheck=1
    gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-6
     
    #released updates 
    [updates]
    name=CentOS-6.9 - Updates - vault.centos.org
    failovermethod=priority
    baseurl=http://vault.centos.org/6.9/updates/$basearch/
    gpgcheck=1
    gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-6
     
    #additional packages that may be useful
    [extras]
    name=CentOS-6.9 - Extras - vault.centos.org
    failovermethod=priority
    baseurl=http://vault.centos.org/6.9/extras/$basearch/
    gpgcheck=1
    gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-6
     
    #additional packages that extend functionality of existing packages
    [centosplus]
    name=CentOS-6.9 - Plus - vault.centos.org
    failovermethod=priority
    baseurl=http://vault.centos.org/6.9/centosplus/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-6
     
    #contrib - packages by Centos Users
    [contrib]
    name=CentOS-6.9 - Contrib - vault.centos.org
    failovermethod=priority
    baseurl=http://vault.centos.org/6.9/contrib/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-6

    更换源后尝试yum update,能够正常获取软件列表即可。

    原文链接:http://diannaobos.com/post/983.html

  • 相关阅读:
    101 上传之手动触发选在文件的上传弹出选择文件框
    11js统一设置多个样式cssText
    11 路由切换时候去掉某个路由的动画效果
    摩尔投票法
    三元环计数
    一些求和式的估算 & 杜教筛时间复杂度证明
    常胜将军!
    20220205 数论
    疯狂JAVA讲义学习——基础代码练习——内部类
    JAVA面向对象学习——java集合———List——List集合代表一个元素有序、可重复的集合,集合中每个元素都有其对应的顺序索引。List集合允许使用重复的元素,并通过索引访问。
  • 原文地址:https://www.cnblogs.com/jiafeimao-dabai/p/14504000.html
Copyright © 2020-2023  润新知