• centos7.4yum错误


    1. 首先删除redhat原有的yum

    1.  
      rpm -aq | grep yum | xargs rpm -e --nodeps
    2.  
      rpm -aq | grep python-iniparse | xargs rpm -e --nodeps

        查看是否已经卸载完成:

    1.  
      rpm -aq | grep yum
    2.  
      rpm -aq | grep python-iniparse

    2. 下载yum安装包

    1.  wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-154.el7.centos.noarch.rpm
    2.  wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
    3.  wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
    4.  wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-42.el7.noarch.rpm
    5. wget http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

    先安装python,在安装yum-metadata 最后两个yum一起安装。

    3. 安装下载的rpm包

    rpm -ivh python-iniparse-0.4-9.el7.noarch.rpm yum-metadata-parser-1.1.4-10.el7.x86_64.rpm yum-3.4.3-154.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-42.el7.noarch.rpm

    4. 创建文件/etc/yum.repos.d/CentOS-Base.repo

    可以使用网易云或阿里云镜像站点:

    网易云镜像:

    [base]
    name=CentOS-$releasever - Base
    baseurl=http://mirrors.163.com/centos/7.4.1708/os/$basearch/
    gpgcheck=1
    gpgkey=http://mirrors.163.com/centos/7.4.1708/os/x86_64/RPM-GPG-KEY-CentOS-7
     
    #released updates
    [updates]
    name=CentOS-$releasever - Updates
    baseurl=http://mirrors.163.com/centos/7.4.1708/updates/$basearch/
    gpgcheck=1
    gpgkey=http://mirrors.163.com/centos/7.4.1708/os/x86_64/RPM-GPG-KEY-CentOS-7
     
    [extras]
    name=CentOS-$releasever - Extras
    baseurl=http://mirrors.163.com/centos/7.4.1708/extras//$basearch/
    gpgcheck=1
    gpgkey=http://mirrors.163.com/centos/7.4.1708/os/x86_64/RPM-GPG-KEY-CentOS-7
     
    [centosplus]
    name=CentOS-$releasever - Plus
    baseurl=http://mirrors.163.com/centos/7.4.1708/centosplus//$basearch/
    gpgcheck=1
    enabled=0

    阿里云镜像:

    [base]
    name=CentOS-$releasever - Base
    baseurl=https://mirrors.aliyun.com/centos/7.4.1708/os/$basearch/
    gpgcheck=1
    gpgkey=https://mirrors.aliyun.com/centos/7.4.1708/os/x86_64/RPM-GPG-KEY-CentOS-7
     
    #released updates
    [updates]
    name=CentOS-$releasever - Updates
    baseurl=https://mirrors.aliyun.com/centos/7.4.1708/updates/$basearch/
    gpgcheck=1
    gpgkey=https://mirrors.aliyun.com/centos/7.4.1708/os/x86_64/RPM-GPG-KEY-CentOS-7
     
    [extras]
    name=CentOS-$releasever - Extras
    baseurl=https://mirrors.aliyun.com/centos/7.4.1708/extras//$basearch/
    gpgcheck=1
    gpgkey=https://mirrors.aliyun.com/centos/7.4.1708/os/x86_64/RPM-GPG-KEY-CentOS-7
     
    [centosplus]
    name=CentOS-$releasever - Plus
    baseurl=https://mirrors.aliyun.com/centos/7.4.1708/centosplus//$basearch/
    gpgcheck=1
    enabled=0

    5. yum clean all

    6. yum makecache(生成本地缓存)

    附:yum源变更说明

    经查从2018年05月24日起阿里云和网易云镜像站点中对于CentOS 7.4.1708版本的yum源已经不做支持,在镜像站点中附带了一个readme文件说明如下:

    解决该站点镜像无法使用的方式有如下两种:

    方式一:将上述第4点中所有的7.4.1708替换为7

    方式二:将上述第4点中所有的mirrors.163.com或mirrors.aliyun.com替换为vault.centos.org

    yum update出现:

  • 相关阅读:
    查看.Net Framework的版本(PC和WinCE)
    .NET C# 创建WebService服务简单的例子
    ORA-01502错误成因和解决方法
    高水线 High water mark(HWM)
    Oracle高水位线(HWM)及性能优化
    解决(Oracle)ORA-12528: TNS: 监听程序: 所有适用例程都无法建立新连接 问题
    ORACLE切非归档模式:
    ArcGIS学习记录—dbf shp shx sbn sbx mdb adf等类型的文件的解释
    ArcGIS学习记录—ArcGIS ArcMap编辑状态中线打断的问题
    ArcGIS学习记录—Arcgis中点、线、面的相互转换方法
  • 原文地址:https://www.cnblogs.com/LHXW/p/9544074.html
Copyright © 2020-2023  润新知