首页 > 系统相关 >解决 CentOS Cannot find a valid baseurl for repo

解决 CentOS Cannot find a valid baseurl for repo

时间:2024-08-13 22:26:59浏览次数:14  
标签:CentOS centos baseurl repo valid releasever vault

参考:Fix "Cannot find a valid baseurl for repo" in CentOS - DEV Community

背景

由于 CentOS 7 镜像被移动到 vault。当执行 yum 时,会报错“Cannot find a valid baseurl for repo: base/7/x86_64”。

解决

/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-$releasever - Base
mirrorlist=http://vault.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=http://vault.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates 
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://vault.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
baseurl=http://vault.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://vault.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
baseurl=http://vault.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://vault.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
baseurl=http://vault.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

更改好后执行sudo yum update -y即可。

标签:CentOS,centos,baseurl,repo,valid,releasever,vault
From: https://www.cnblogs.com/Higurashi-kagome/p/18357830

相关文章

  • wpf ValidationRule 校验数据输入
    publicclassCountValidationRule:ValidationRule{publicoverrideValidationResultValidate(objectvalue,System.Globalization.CultureInfocultureInfo){doubled=0.0;if(double.TryParse((string)value,out......
  • centos7配置yum源 安装 docker 安装Docker Compose 安装Python 3.7并汉化 (python可不
    安装一个软件确认无误就执行备份,在关键步骤之前一定做好备份以防止重来,造成时间的大量浪费注意有时因各自网络环境原因,wget显示拒绝连接,要么等五分钟再试要么就把网址粘贴到百度去下载相对应的安装包,通过ftp,xftp等拷贝到虚拟机中。若有问题欢迎评论留言,我会尝试解决。现......
  • CentOS7.8安装expect及使用
    原文链接:https://blog.csdn.net/qq_41944882/article/details/105956317一、概述通过Shell可以实现简单的控制流功能,如:循环、判断等。但是对于需要交互的场合则必须通过人工来干预,有时候我们可能会需要实现和交互程序如telnet服务器等进行交互的功能。而Expect就使用来实现这种功......
  • 【CentOS 】DHCP 更改为静态 IP 地址并且遇到无法联网
    文章目录引言解决方式标题1.**编辑网络配置文件**:标题2.**确保配置文件包含以下内容**:特别注意标题3.**重启网络服务**:标题4.**检查配置是否生效**:标题5.**测试网络连接**:标题6.**检查路由表**:标题7.**检查防火墙设置**:标题8.**检查SELinux状态**:标题9.**检......
  • playwright启动后报错net::ERR_CERT_COMMON_NAME_INVALID 解决方法
    运行playwright测试用例报错:1、如果是在跑测试的时候报错,在创建上下文时设置ignore_https_errors=True就可以了,如:fromidlelibimportbrowserfromplaywright.sync_apiimportPlaywrightdefgetPage(playwright:Playwright):chromium=playwright.chromium......
  • flannel容器启动失败,日志报错“Failed to find any valid interface to use: failed t
    现状k8s部署,flannel容器起不来,不断重启,查看日志报错"Failedtofindanyvalidinterfacetouse:failedtogetdefaultinterface:Unabletofinddefaultroute"排查过程根据报错提示,可能是网卡名称奇怪导致,或者没有默认路由查看默认路由很显然是有默认路由的查......
  • centos 配置或安装国内yum源
    前言:本文先讲述配置yum,再讲述安装yum,因为一般系统会已经安装有yum了的,可以直接输入指令yum-回车确认(如下述安装-第6点)。一、配置yum1、查看看是否存在yum[root@localhost~]#rpm-qa|grepyumyum-langpacks-0.4.2-7.el7.noarchyum-3.4.3-168.el7.centos.noarchPackage......
  • Nginx:Centos-7安装Nginx并配置阿里的SSL证书
    1.安装编译工具在线安装yum-yinstallmakezlibzlib-develgcc-c++libtoolopensslopenssl-devel2.安装PCRE依赖库说明PCRE(PerlCompatibleRegularExpressions)是一个重要的依赖库,它提供了对正则表达式的支持。在Nginx的配置中,正则表达式用于匹配和处理URL、请求......
  • 【零基础必看的Linux教程】——Linux 安装(CentOs)
    本章节我们将为大家介绍Linux的安装,安装步骤比较繁琐,现在其实云服务器挺普遍的,价格也便宜,如果自己不想搭建,也可以直接买一台学习用用。本教程以centos6.4为例。给大家附上centos下载地址:centos下载地址https://www.centos.org/download/以下针对各个版本的ISO镜像文......
  • centos 配置静态ip
    1、查看ip地址[root@localhostnetwork-scripts]#ipaddr1:lo:<LOOPBACK,UP,LOWER_UP>mtu65536qdiscnoqueuestateUNKNOWNgroupdefaultqlen1000link/loopback00:00:00:00:00:00brd00:00:00:00:00:00inet127.0.0.1/8scopehostlovalid_......