zoukankan      html  css  js  c++  java
  • YUMREPO ERROR: ALL MIRROR URLS ARE NOT USING FTP, HTTP[S] OR FILE

    CentOS中执行yum update时,会报如下错误:

    Loaded plugins: fastestmirror, refresh-packagekit, security
    Setting up Update Process
    Determining fastest mirrors
    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 find a valid baseurl for repo: base
    

    这是因为在CentOS 6在2020年11月30过后,就不在维护了,使用如下方法解决:

    1. 进入/etc/yum.repos.d/
    # cd /etc/yum.repos.d/
    
    1. 编辑CentOS-Base.repo
    # 先备份
    # cp CentOS-Base.repo CentOS-Base.repo.old
    
    # 编辑
    # vim CentOS-Base.repo
    
    1. 编辑如下几个块
    • [base]
    • [updates]
    • [extras]

    内容如下:

    [base]
    name=CentOS-$releasever - Base
    # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
    # baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
    baseurl=https://vault.centos.org/6.10/os/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    
    # released updates
    [updates]
    name=CentOS-$releasever - Updates
    # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
    # baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
    baseurl=https://vault.centos.org/6.10/updates/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    
    # additional packages that may be useful
    [extras]
    name=CentOS-$releasever - Extras
    # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
    # baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
    baseurl=https://vault.centos.org/6.10/extras/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    
    1. 清楚缓存
    # yum clean all
    
    1. 重新执行更新
    # yum update
    

  • 相关阅读:
    【转】StackExchange.Redis 事务控制和Batch批量操作
    mysql 修改时子查询的问题
    mysql 对于有null值的 NOT IN和NOT EXISTS
    【转】Core使用Redis做Session进程外储存
    Filter的注入方式 NET Core
    MiddleWare中间键实现 简单的防盗链 AOP
    c# Jenkins+PowerShell持续集成环境搭建
    VS2019下载离线安装包
    1226 六晴
    1225 五 晴
  • 原文地址:https://www.cnblogs.com/bilberry/p/14277085.html
Copyright © 2011-2022 走看看