首页 > 其他 > 详细

yum源中$releasever不能被系统识别

时间:2020-02-18 20:49:53      阅读:178      评论:0      收藏:0      [点我收藏+]

一、现象

使用yum makecache命令时报错

[root@MiWiFi-R3L-srv ~]# yum makecache
Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
http://mirrors.aliyun.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below wiki article 

 

二、原因

  1. yum中的变量$releasever是由/etc/yum.conf中的distroverpkg定义的
  2. “distroverpkg=centos-release”  #将 $releasever设置为centos-release 这个RPM包的版本号
  3. centos-release是一个rpm包(通过:rpm可以查询到该软件包并没有被安装)
    rpm -q centos-release

三、解决方案

  1. 由于$releasever无法被识别,无法使用yum安装,可以修改yum源文件,把$releasever全部替换为7(注意先备份源文件)
  2. 通过yum安装centos-release
    yum install centos-release -y
  3. 用备份的yum源文件覆盖修改的yum源文件

参考地址:

https://www.jianshu.com/p/925960eaeb21

https://www.repo.cloudlinux.com/cloudlinux/migrate/release-files/centos/7/x86_64/

 

yum源中$releasever不能被系统识别

原文:https://www.cnblogs.com/jayce9102/p/12327472.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!