关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

CentOS6.5 YUM 源失效问题解决办法

发布时间:2021-09-10 08:53:38

今天有客户需要安装centos6.5系统,结果yum 报错,查了一下原因,国外已经停止维护6以下版本的yum源。

问题描述

Yum 源失效,无法正常使用 Yum,错误信息如下:

[root@dsjidc ~]# yum -y install samba samba-common samba-client

Loaded plugins: fastestmirror, refresh-packagekit, security

YumRepo Error: All mirror URLs are not using ftp, http[s] or file.

 Eg. Invalid release/repo/arch combination/

removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt

Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again


问题解决

不想挂载本地yum源了,找到量个 Yum 源地址:


http://mirrors.aliyun.com/centos-vault/6.5/os/x86_64/  速度猛如虎


https://vault.centos.org/6.5/os/x86_64/ 国外的卡的一比



操作简单,把CentOS-Base.repo 里面的东西全部删掉,添加如下内容即可。


备份原文件:


mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak


编辑


vi /etc/yum.repos.d/CentOS-Base.repo


内容:


[base]

name=CentOS-6

failovermethod=priority

baseurl=http://mirrors.aliyun.com/centos-vault/6.5/os/x86_64/

gpgcheck=0

测试:


[root@dsjidc ~]# yum -y install samba samba-common samba-client

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

base                                                                                                                                                                                                      | 3.7 kB     00:00     

base/primary_db                                                                                                                                                                                           | 4.4 MB     01:19     

Setting up Install Process

Package samba-3.6.9-164.el6.x86_64 already installed and latest version

Package samba-common-3.6.9-164.el6.x86_64 already installed and latest version

Package samba-client-3.6.9-164.el6.x86_64 already installed and latest version

Nothing to do

 


/template/Home/Zkeys/PC/Static