美文网首页centos
CentOS8使用阿里云yum源异常

CentOS8使用阿里云yum源异常

作者: 萌褚 | 来源:发表于2022-04-19 14:44 被阅读0次

镜像下载、域名解析、时间同步请点击 阿里云开源镜像站

Linux安装git时发生如下错误

[root@raoyuuuu maven]# dnf install git
Repository extras is listed more than once in the configuration
Repository epel is listed more than once in the configuration
CentOS-8 - Base - mirrors.aliyun.com                                                                                                                                                                                                         
Errors during downloading metadata for repository 'base':
  - Curl error (28): Timeout was reached for http://mirrors.aliyuncs.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml [Connection timed out after 30000 milliseconds]
  - Status code: 404 for https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml (IP: 106.15.218.235)
  - Status code: 404 for http://mirrors.cloud.aliyuncs.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml (IP: 100.100.2.148)
Error: Failed to download metadata for repo 'base': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

使用yum makecache命令也是一样的问题

原因:

由于centos8 在2022年停止服务,后继版本为8-steam。在使用阿里云的 centos8 的 yum 时报错。

根据上面说法只要将版本号替换即可
可以拿报错信息里的地址测试一下

file

将8替换成8-stream

file

说明确实是版本的问题,因为前两篇测试后太过繁琐,直接按第三篇的方法

解决方案

1、进入配置文件内,删除所有的.repo文件(也可以备份)

#进入配置文件夹
cd /etc/yum.repos.d/
#删除旧的配置文件
rm *.repo
#输入“y”回车确认

ls确保该目录下的.repo文件已完全删除
下载可以用的.repo文件

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

如果你没有安装wget,也可以用下面命令:

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

运行 yum makecache 生成缓存

yum makecache

完成

file

安装git也成功

file

本文转自:https://blog.csdn.net/RoyRaoHR/article/details/123005317

相关文章

  • CentOS8使用阿里云yum源异常

    镜像下载、域名解析、时间同步请点击 阿里云开源镜像站[https://developer.aliyun.com/m...

  • centos更换yum源

    更换系统默认yum 源 更换yum源为阿里云yum源 备份系统默认的yum源 下载阿里云yum源 添加 epel ...

  • 腾讯云 centos 7.x 安装 lnmp 环境

    1 将本地的yum源 切换为 阿里云yum源 阿里云 镜像列表 ->找到centos 2 安装php7.1X 使用...

  • centos系统中yum安装应用出现doesn't have e

    解决方法:修改默认yum源为阿里云yum源,步骤如下: 备份原有yum源: 创建yum源目录 下载阿里云yum源配...

  • CentOS8 yum安装AppStream报错问题

    更换国内yum源: 更换国内yum源,推荐阿里云yum或者腾讯yum。 阿里yum源: https://devel...

  • Linux 搭建SVN服务器(C/S模式)

    Linux System Environment 一、配置阿里云yum源和epel源提示:阿里云yum源官网 ht...

  • centos中lnmp的安装

    写在最前面,在安装之前,最好配置163yum源,或者阿里云的yum源可以使用163的yum源:wget http:...

  • yum源

    国内yum源的安装(163,阿里云,epel) ----阿里云镜像源 1、备份 mv /etc/yum.repos...

  • 2019-12-09

    国内yum源的安装(163,阿里云,epel) ----阿里云镜像源 1、备份 mv /etc/yum.repos...

  • Centos Issue

    CentOS配置本地Yum源、阿里云Yum源、163Yum源、并配置Yum源的优先级

网友评论

    本文标题:CentOS8使用阿里云yum源异常

    本文链接:https://www.haomeiwen.com/subject/xovsertx.html