两步办理yum无法安装软件问题:Cannot find a valid baseurl for repo: cen ...

打印 上一主题 下一主题

主题 808|帖子 808|积分 2424

报错信息:
  1. [root@iZwz946ibli8ikuyqgtc58Z ~]# yum install rh-redis5-redis
  2. Loaded plugins: fastestmirror
  3. Loading mirror speeds from cached hostfile
  4. Could not retrieve mirrorlist http://mirrorlist.centos.org?arch=x86_64&release=7&repo=sclo-rh error was
  5. 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
  6. One of the configured repositories failed (Unknown),
  7. and yum doesn't have enough cached data to continue. At this point the only
  8. safe thing yum can do is fail. There are a few ways to work "fix" this:
  9.      1. Contact the upstream for the repository and get them to fix the problem.
  10.      2. Reconfigure the baseurl/etc. for the repository, to point to a working
  11.         upstream. This is most often useful if you are using a newer
  12.         distribution release than is supported by the repository (and the
  13.         packages for the previous distribution release still work).
  14.      3. Run the command with the repository temporarily disabled
  15.             yum --disablerepo=<repoid> ...
  16.      4. Disable the repository permanently, so yum won't use it by default. Yum
  17.         will then just ignore the repository until you permanently enable it
  18.         again or use --enablerepo for temporary usage:
  19.             yum-config-manager --disable <repoid>
  20.         or
  21.             subscription-manager repos --disable=<repoid>
  22.      5. Configure the failing repository to be skipped, if it is unavailable.
  23.         Note that yum will try to contact the repo. when it runs most commands,
  24.         so will have to try and fail each time (and thus. yum will be be much
  25.         slower). If it is a very temporary problem though, this is often a nice
  26.         compromise:
  27.             yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
  28. Cannot find a valid baseurl for repo: centos-sclo-rh/x86_64
复制代码
出错缘故起因: 上述错误信息表明无法检索镜像列表,缘故起因是 http://mirrorlist.centos.org 已经制止服务了,因此我们需要更改scl源的baseUrl。
办理方案:
1、进入/etc/yum.repos.d目录,删除目录下面全部的软件包,删除下令如下:
  1. sudo rm -rf *
复制代码

2、下载安装阿里云镜像仓库:两条下令都行
  1. sudo curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
  2. sudo wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
复制代码
3、下载安装阿里云epel.repo:
  1. sudo curl -o /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
  2. sudo wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
复制代码
4、扫除缓存:
  1. yum clean all
复制代码
5、天生缓存:
  1. yum makecache
  2. yum makecache fast
复制代码
6、安装gcc-c++测试:
  1. sudo yum -y install gcc-c++
复制代码
7、效果展示:安装成功


免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

用户国营

金牌会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表