zoukankan      html  css  js  c++  java
  • How to fix yum after CentOS 6 went EOL

     

    We have by far the largest RPM repository with NGINX module packages and VMODs for Varnish. If you want to install NGINX, Varnish, and lots of useful performance/security software with smooth yum upgrades for production use, this is the repository for you.
    Active subscription is required.

    If for whatever reason, you are stuck with the now EOL version of the CentOS operating system, you can no longer run yum upgrade successfully. Running yum upgrade in CentOS 6 will yield the following results:

    Setting up Upgrade Process
    YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
    Eg. Invalid release/repo/arch combination/
    removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt
    Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

    Rightfully so, as the YUM repository was removed from the main CentOS update servers, no security or feature upgrades are provided.

    However, not all the repositories have halted their support for CentOS 6. The GetPageSpeed repository still provides up-to-date NGINX builds and its module packages.

    This may be one reason why you want yum upgrade to still work. Or simply, you are not ready to move on with a newer operating system, and willing to take the security risks associated with using the older version.

    How to fix yum upgrade then?

    Use the CentOS Vault repository

    The CentOS Vault repositories have been around for a long time and allow you to stick to a specific CentOS x.y release even while newer ones are available. Now that there will be no newer 6.x, you can simply point your yum repository configuration to the latest 6.x that will ever be, which is 6.10.

    To use the Vault repository, set up its repo configuration instead of the now defunct repositories configuration:

    curl https://www.getpagespeed.com/files/centos6-eol.repo --output /etc/yum.repos.d/CentOS-Base.repo

    That’s it, everything should be functional.

    Alternatively, you can manually replace the contents of the file /etc/yum.repos.d/CentOS-Base.repo with the necessary configuration.

    Copy-paste the entire snippet below and hit Enter:

    cat <<-'EOF' > /etc/yum.repos.d/CentOS-Base.repo
    [C6.10-base]
    name=CentOS-6.10 - Base
    baseurl=http://vault.centos.org/6.10/os/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    enabled=1
    metadata_expire=never
    
    [C6.10-updates]
    name=CentOS-6.10 - Updates
    baseurl=http://vault.centos.org/6.10/updates/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    enabled=1
    metadata_expire=never
    
    [C6.10-extras]
    name=CentOS-6.10 - Extras
    baseurl=http://vault.centos.org/6.10/extras/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    enabled=1
    metadata_expire=never
    
    [C6.10-contrib]
    name=CentOS-6.10 - Contrib
    baseurl=http://vault.centos.org/6.10/contrib/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    enabled=0
    metadata_expire=never
    
    [C6.10-centosplus]
    name=CentOS-6.10 - CentOSPlus
    baseurl=http://vault.centos.org/6.10/centosplus/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    enabled=0
    metadata_expire=never
    EOF

    Now you can run yum upgrade without problems. This also allows you to get to the latest release 6.10 even if you were left behind at, e.g. 6.7.

    Not only yum upgrade works, but you can also install arbitrary packages as usual.

    Fixing EPEL repository

    curl https://www.getpagespeed.com/files/centos6-epel-eol.repo --output /etc/yum.repos.d/epel.repo

    Fixing SCLO repositories

    The repositories containing newer compilation software like gcc is available via Software Collections.
    However, its repositories are likewise gone. Use Vault repositories instead:

    yum -y install centos-release-scl
    curl https://www.getpagespeed.com/files/centos6-scl-eol.repo --output /etc/yum.repos.d/CentOS-SCLo-scl.repo
    curl https://www.getpagespeed.com/files/centos6-scl-rh-eol.repo --output /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
    喜欢请赞赏一下啦^_^

    微信赞赏

    支付宝赞赏

  • 相关阅读:
    面试题中关于String的常见操作
    base64 加密 解密 Java代码实现 【尝试 博客园 用Markdown 编写】
    md5 32位 加密原理 Java实现md5加密
    base64 加密原理 解密原理
    2018年 10月份开始执行的最新税率表 2019年1月 小孩住房贷款等怎么扣
    安装Zookeeper和kafka,安装完毕后,遇到的错误
    Jmeter自动化测试 数据驱动测试,将数据存入csv文件中来调用,或将数据存在DB中进行调用
    Jmeter 同一个测试计划下的多个线程组 执行顺序 希望调整为顺序执行
    Json多层嵌套,要怎么提取?
    总结下我遇到过的接口测试
  • 原文地址:https://www.cnblogs.com/lkj371/p/15352342.html
Copyright © 2011-2022 走看看