开发者社区> 问答> 正文

CentOS 5系统中执行yum命令报错

执行 yum install等命令,产生错误。

展开
收起
开发者说 2019-07-25 18:06:50 742 0
1 条回答
写回答
取消 提交回答
  • 概述

    本文主要介绍在CentOS 5系统中执行yum命令报错的解决方法。

    问题症状

    执行 yum install等命令,产生错误。

    问题原因

    配置的yum源出错,在mirrors.aliyun.com/centos/5/中没有如下截图中的文件,只有一个readme文件。

    解决方案

    1. 修改CentOS-Base.repo配置文件,修改后文件内容如下。 #CentOS-Base.repo

    #The mirror system uses the connecting IP address of the client and the #update status of each mirror to pick mirrors that are updated to and #geographically close to the client. You should use this for CentOS updates #unless you are manually picking other mirrors.

    #If the mirrorlist= does not work for you, as a fall back you can try the #remarked out baseurl= line instead.

    [base] name=CentOS-$releasever - Base - mirrors.aliyun.com failovermethod=priority baseurl=http://vault.centos.org/5.11/os/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os gpgcheck=1 gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-5

    #released updates [updates] name=CentOS-$releasever - Updates - mirrors.aliyun.com failovermethod=priority baseurl=http://vault.centos.org/5.11/updates/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates gpgcheck=1 gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-5

    #additional packages that may be useful [extras] name=CentOS-$releasever - Extras - mirrors.aliyun.com failovermethod=priority baseurl=http://vault.centos.org/5.11/extras/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras gpgcheck=1 gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-5

    #packages used/produced in the build but not released [addons] name=CentOS-$releasever - Addons - mirrors.aliyun.com failovermethod=priority baseurl=http://vault.centos.org/5.11/addons/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

    #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus - mirrors.aliyun.com failovermethod=priority baseurl=http://vault.centos.org/5.11/centosplus/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus gpgcheck=1 enabled=0 gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-5

    #contrib - packages by Centos Users [contrib] name=CentOS-$releasever - Contrib - mirrors.aliyun.com failovermethod=priority baseurl=http://vault.centos.org/5.11/contrib/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib gpgcheck=1 enabled=0 gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-5 2. 重新执行yum命令,恢复正常。

    2019-07-25 18:08:11
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
CentOS Nginx PHP JAVA 多语言镜像使用手 立即下载
CentOS Nginx PHP JAVA多语言镜像使用手册 立即下载
低代码开发师(初级)实战教程 立即下载

相关实验场景

更多