当前位置: 首页 > news >正文

两步解决yum无法安装软件问题:Cannot find a valid baseurl for repo: centos-sclo-rh/x86_64

报错信息:

[root@iZwz946ibli8ikuyqgtc58Z ~]# yum install rh-redis5-redis
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org?arch=x86_64&release=7&repo=sclo-rh error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"One of the configured repositories failed (Unknown),and yum doesn't have enough cached data to continue. At this point the onlysafe thing yum can do is fail. There are a few ways to work "fix" this:1. Contact the upstream for the repository and get them to fix the problem.▽2. Reconfigure the baseurl/etc. for the repository, to point to a workingupstream. This is most often useful if you are using a newerdistribution release than is supported by the repository (and thepackages for the previous distribution release still work).3. Run the command with the repository temporarily disabledyum --disablerepo=<repoid> ...4. Disable the repository permanently, so yum won't use it by default. Yumwill then just ignore the repository until you permanently enable itagain or use --enablerepo for temporary usage:yum-config-manager --disable <repoid>orsubscription-manager repos --disable=<repoid>5. Configure the failing repository to be skipped, if it is unavailable.Note that yum will try to contact the repo. when it runs most commands,so will have to try and fail each time (and thus. yum will be be muchslower). If it is a very temporary problem though, this is often a nicecompromise:yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=trueCannot find a valid baseurl for repo: centos-sclo-rh/x86_64

出错原因: 上述错误信息表明无法检索镜像列表,原因是 http://mirrorlist.centos.org 已经停止服务了,因此我们需要更改scl源的baseUrl。

解决方案:
1、进入/etc/yum.repos.d目录,删除目录下面所有的软件包,删除命令如下:

sudo rm -rf *

在这里插入图片描述

2、下载安装阿里云镜像仓库:两条命令都行

sudo curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.reposudo wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

3、下载安装阿里云epel.repo:

sudo curl -o /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.reposudo wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo

4、清除缓存:

yum clean all 

5、生成缓存:

yum makecache
yum makecache fast

6、安装gcc-c++测试:

sudo yum -y install gcc-c++

7、结果展示:安装成功

在这里插入图片描述

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • 云动态摘要 2024-09-04
  • Spring Security中的BCrpt介绍,及其与SHA-256的对比
  • 【图论】Dijkstra算法求最短路
  • OrangePi AIpro 香橙派 昇腾 Ascend C 算子开发 与 调用 - Tiling实现 2
  • 使用Nginx获取客户端真实IP(real_ip_header)
  • 第三章 数组 课后训练(4)
  • mysql学习教程,从入门到精通,MySQL创建数据库教程(5)
  • C++ | Leetcode C++题解之第391题完美矩形
  • 【drools】kie:官方仓库clone 遇到问题解决
  • Select模型
  • VMware Workstation v17.6 中文注册精简版
  • 使用mysqldump命令时提示ERROR 1064 (42000)
  • LeetCode 2860.让所有学生保持开心的分组方法数:排序+遍历
  • 分享——有趣的题目
  • 一文教你学会java代码审计
  • (十五)java多线程之并发集合ArrayBlockingQueue
  • [译] React v16.8: 含有Hooks的版本
  • 【许晓笛】 EOS 智能合约案例解析(3)
  • 2017 前端面试准备 - 收藏集 - 掘金
  • Debian下无root权限使用Python访问Oracle
  • Java基本数据类型之Number
  • k8s 面向应用开发者的基础命令
  • KMP算法及优化
  • node和express搭建代理服务器(源码)
  • 程序员该如何有效的找工作?
  • 紧急通知:《观止-微软》请在经管柜购买!
  • 浅谈Kotlin实战篇之自定义View图片圆角简单应用(一)
  • 使用putty远程连接linux
  • 赢得Docker挑战最佳实践
  • NLPIR智能语义技术让大数据挖掘更简单
  • ​软考-高级-系统架构设计师教程(清华第2版)【第1章-绪论-思维导图】​
  • # AI产品经理的自我修养:既懂用户,更懂技术!
  • ## 基础知识
  • ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLTr
  • #DBA杂记1
  • #define,static,const,三种常量的区别
  • #QT项目实战(天气预报)
  • #我与Java虚拟机的故事#连载08:书读百遍其义自见
  • #我与Java虚拟机的故事#连载12:一本书带我深入Java领域
  • $(selector).each()和$.each()的区别
  • (CPU/GPU)粒子继承贴图颜色发射
  • (rabbitmq的高级特性)消息可靠性
  • (顶刊)一个基于分类代理模型的超多目标优化算法
  • (深入.Net平台的软件系统分层开发).第一章.上机练习.20170424
  • (四)图像的%2线性拉伸
  • (已解决)vue+element-ui实现个人中心,仿照原神
  • (原创)可支持最大高度的NestedScrollView
  • (原創) 系統分析和系統設計有什麼差別? (OO)
  • (转)母版页和相对路径
  • (转载)利用webkit抓取动态网页和链接
  • *p++,*(p++),*++p,(*p)++区别?
  • .bat批处理(九):替换带有等号=的字符串的子串
  • .NET CLR基本术语
  • .NET Core SkiaSharp 替代 System.Drawing.Common 的一些用法
  • .NET 中选择合适的文件打开模式(CreateNew, Create, Open, OpenOrCreate, Truncate, Append)