zoukankan      html  css  js  c++  java
  • CentOS 6的yum源配置(最新地址)

    CentOS 6 操作系统版本结束了生命周期(EOL),Linux社区已不再维护该操作系统版本。建议您升级操作系统至CentOS 7及以上,如果您的业务过渡期仍需要使用CentOS 6系统中的一些安装包,请根据下文切换CentOS 6的源。

    背景信息
    2020年11月30日CentOS 6 EOL。按照社区规则,CentOS 6的源地址http://mirror.centos.org/centos-6/内容已移除,目前第三方的镜像站中均已移除CentOS 6的源。阿里云的源http://mirrors.cloud.aliyuncs.com和http://mirrors.aliyun.com也无法同步到CentOS 6的源。
    当您在使用默认配置的CentOS 6的源会发生报错。报错示例如下图所示:

    ##  https://www.cnblogs.com/liucx/

    解决方法:
    CentOS-Base源

    cat > /etc/yum.repos.d/CentOS-Base.repo <<EOF
    [base]
    name=CentOS-6.10
    enabled=1
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos-vault/6.10/os/$basearch/
    gpgcheck=1
    gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
    [updates]
    name=CentOS-6.10
    enabled=1
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos-vault/6.10/updates/$basearch/
    gpgcheck=1
    gpgkey=http://mirrors.aliyun.comm/centos-vault/RPM-GPG-KEY-CentOS-6
    [extras]
    name=CentOS-6.10
    enabled=1
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos-vault/6.10/extras/$basearch/
    gpgcheck=1
    gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
    [epel]
    name=Extra Packages for Enterprise Linux 6 - $basearch
    enabled=1
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/epel-archive/6/$basearch
    gpgcheck=0
    gpgkey=http://mirrors.aliyun.com/epel-archive/RPM-GPG-KEY-EPEL-6
    EOF
    

    epel源

    cat > /etc/yum.repos.d/epel.repo <<EOF
    [epel]
    name=Extra Packages for Enterprise Linux 6 - $basearch
    enabled=1
    failovermethod=priority
    baseurl=http://mirrors.aliyuncs.com/epel-archive/6/$basearch
    gpgcheck=0
    gpgkey=http://mirrors.aliyuncs.com/epel-archive/RPM-GPG-KEY-EPEL-6
    EOF

    运行以下命令生成缓存

    yum clean all
    yum makecache
    

    参考:https://help.aliyun.com/document_detail/193569.htm

    作者:Liucx
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.
  • 相关阅读:
    docker安装
    linux磁盘空间挂载
    python之MD5加密
    python之pymysql
    python 之Redis笔记
    python 随机生成中文名字
    python之json笔记
    python时间模块笔记
    python 用pip安装pymysql(win7下)
    数据库操作番外篇~
  • 原文地址:https://www.cnblogs.com/liucx/p/14745726.html
Copyright © 2011-2022 走看看