Centos使用yum安装时AppStream报错

Centos使用yum安装时AppStream报错

想要安装gbd时运行如下语句

# yum install gdb

报错如下

Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Epel.repo;
Configuration: OptionBinding with id "failovermethod" does not exist Repository epel is listed more than once in the configuration 
CentOS Linux 8 - AppStream                                        27  B/s |  38  B     00:01    
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

原因是由于下载镜像有误导致下载不下来

首先进入/ect/yum.repos.d/,ls一下发现有很多repo文件。

什么是repo文件?repo文件是Fedora中yum源(软件仓库)的配置文件,通常一个repo文件定义了一个或者多个软件仓库的细节内容,例如我们将从哪里下载需要安装或者升级的软件包,repo文件中的设置内容将被yum读取和应用!

[root@VM-24-17-centos yum.repos.d]# ls 
CentOS-AppStream.repo          CentOS-centosplus.repo.rpmsave  CentOS-Linux-AppStream.repo          CentOS-Linux-Extras.repo            CentOS-Linux-PowerTools.repo    epel-playground.repo CentOS-AppStream.repo.rpmsave  CentOS-Devel.repo.rpmsave       CentOS-Linux-BaseOS.repo             CentOS-Linux-FastTrack.repo         CentOS-Linux-Sources.repo       epel.repo CentOS-Base.repo               CentOS-Epel.repo                CentOS-Linux-ContinuousRelease.repo  CentOS-Linux-HighAvailability.repo  CentOS-PowerTools.repo.rpmsave  epel-testing-modular.repo CentOS-Base.repo.backup.3      CentOS-Extras.repo.rpmsave      CentOS-Linux-Debuginfo.repo          CentOS-Linux-Media.repo             docker-ce.repo                  epel-testing.repo CentOS-Base.repo.rpmsave       CentOS-HA.repo.rpmsave          CentOS-Linux-Devel.repo              CentOS-Linux-Plus.repo              epel-modular.repo

一开始一以为是CentOS-AppStream.repo和CentOS-Base.repo文件的问题,因此通过下面的语句下载了腾讯yum镜像

参考:https://www.cnblogs.com/bpzblog/p/13918199.html

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos8_base.repo

但后来运行发现问题是在 CentOS-Linux-AppStream.repo和CentOS-Linux-BaseOS.repo中。vim一下两个文件进行更改,把mirrorlist注释掉,把baseurl改成腾讯云

#mirrorlist=http://mirrorlist.centos.org/release=$releasever&arch=$basearch&repo=AppStream&infra=$infra 
baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/AppStream/$basearch/os/ 
#baseurl=http://mirror.centos.org/$contentdir/$releasever/AppStream/$basearch/os/

你可能感兴趣的:(前端,html,面试,centos,linux,服务器)