计算化学公社

标题: 求助yum无法下载安装软件 [打印本页]

作者
Author:
djjj148    时间: 2020-9-27 18:56
标题: 求助yum无法下载安装软件
CentOS 7.6实体机,根据sob老师的《在VMware 15中安装CentOS 7.6的完整过程视频演示》(http://sobereva.com/454中虚拟机的介绍装的实体机。vasp,Gaussian,ORCA都可以成功安装并运行。
昨晚为了装CP2K,想先把gcc版本升级到5以上(默认4.8.5)。
于是运行视频中介绍的命令yum install centos-release-scl,结果显示如下:
http://ftp.tc.edu.tw/Linux/CentOS/7.8.2003/extras/x86_64/Packages/centos-release-scl-rh-2-3.el7.centos.noarch.rpm: [Errno -1] Package does not match intended download. Suggestion: run yum --enablerepo=extras clean metadata
Trying other mirror.
centos-release-scl-2-3.el7.cen FAILED                                          
http://mirrors.bfsu.edu.cn/centos/7.8.2003/extras/x86_64/Packages/centos-release-scl-2-3.el7.centos.noarch.rpm: [Errno -1] Package does not match intended download. Suggestion: run yum --enablerepo=extras clean metadata
Trying other mirror.


Error downloading packages:
  centos-release-scl-rh-2-3.el7.centos.noarch: [Errno 256] No more mirrors to try.
  centos-release-scl-2-3.el7.centos.noarch: [Errno 256] No more mirrors to try.
于是自行谷歌找到一些办法
一、更新yum
  yum clean all
  yum makecache
  yum update -y
二、若不行,可能是因为DNS不稳定吧,因为yum安装时会从三个”repo源“(base,extras,updates)随机获取地址
(1)编辑网络配置:vi /etc/sysconfig/network-scripts/ifcfg-eth0
在本地网关DNS1下,添加aliyun网关 DNS2=223.5.5.5(可以理解为:将base,updates的“repo源”换为aliyun的)
重启网络服务:service network restart
(2)上步骤若还不行,请继续以下步骤(换yum源,可以理解为上一步的plus,再将extras换为aliyun的源)
 先备份老源:mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
 CentOS7系统:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
具体方法参考阿里云官方:https://developer.aliyun.com/mir ... .0.0.3e221b11iDH0bA
(3)刷新并生成缓存
  yum clean all
  yum makecache
我逐一尝试后发现仍然不行,现在运行yum命令甚至已经返回这样的结果
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile


One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe 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 working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=<repoid> ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>
        or
            subscription-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 much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: centos-sclo-rh/x86_64
而后又通过在谷歌上搜索以上报错信息,尝试1. 更换清华源,2. vi /etc/resolv.conf,增加 nameserver 8.8.8.8后重启网络等方法,折腾了四五个小时,基本上把谷歌上能搜到的都试了,仍然报错“Cannot find a valid baseurl for repo: centos-sclo-rh/x86_64”且无法恢复。实在不知道怎么办,请各位老师同学帮帮忙,非常感谢!

作者
Author:
sobereva    时间: 2020-9-28 12:22
既然装新系统,还不如直接装个CentOS 8,各种程序版本都比较新,省得自己折腾半天升级了,以后装其它程序也方便
图省事的话索性直接用官方预编译的CP2K就完了,CentOS 7.x下什么额外的都不需要装直接就能用
作者
Author:
djjj148    时间: 2020-9-29 20:08
sobereva 发表于 2020-9-28 12:22
既然装新系统,还不如直接装个CentOS 8,各种程序版本都比较新,省得自己折腾半天升级了,以后装其它程序也 ...

谢谢sob老师,看来8.0的系统更方便




欢迎光临 计算化学公社 (http://bbs.keinsci.com/) Powered by Discuz! X3.3