zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    C++结构体成员列表初始化
    hdu-3790-最短路径问题(Dijkstra)
    hdu--1878--欧拉回路(并查集判断连通,欧拉回路模板题)
    nyoj-1278-Prototypes analyze(二叉排序树模板)
    hdu-5183-Negative and Positive (NP)(hash模板)
    nyoj-130-相同的雪花(hash)
    详细介绍C++STL:unordered_map
    NYOJ-626-intersection set(二分查找)
    hdoj-2141-Can you find it?(二分查找)
    HDU-1232-畅通工程(并查集)
  • 原文地址:https://www.cnblogs.com/jiafeimao-dabai/p/14504000.html
Copyright © 2011-2022 走看看