码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • CentOS8使用阿里云yum源异常问题及解决方法


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

    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 时报错。

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

    将8替换成8-stream

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

    解决方案

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

    1

    2

    3

    4

    5

    #进入配置文件夹

    cd /etc/yum.repos.d/

    #删除旧的配置文件

    rm *.repo

    #输入“y”回车确认

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

    1

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

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

    1

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

    运行 yum makecache 生成缓存

    1

    yum makecache

    完成

    安装git也成功

  • 相关阅读:
    趁热打铁,一起来看下Airtest1.2.7新增的那些断言API
    EATON XV-440-10TVB-1-13-1工业显示屏模块
    【STL】map容器
    【MySQL】MySQL数据库锁使用与InnoDB加锁的原理解析(MySQL专栏启动)
    2023年云南省职业院校技能大赛中职组“网络安全”赛项样题
    姿态分析开源工具箱MMPose安装及使用示例(2d face landmark detection)
    C# 一些工具集优化使用(String,Random,Assembly,Json)
    Leetcode刷题详解——找到字符串中所有字母异位词
    【ijkplayer】编译 Android 版本的 ijkplayer ⑦ ( 使用 AS 打开源码 | 重新设置 AGP 和 Gradle 版本号 | 设置依赖仓库 | 设置依赖 | 编译运行 )
    损失函数——机器学习
  • 原文地址:https://blog.csdn.net/jh035/article/details/128012662
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号