飞道的博客

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

451人阅读  评论(0)

今天想在centos6.5下装台samba服务,结果yum 报错,查了一下原因,国外已经停止维护6下的yum源。

问题描述

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


  
  1. [root@openvpn ~] # yum -y install samba samba-common samba-client
  2. Loaded plugins: fastestmirror, refresh-packagekit, security
  3. YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
  4.  Eg. Invalid release/repo/arch combination/
  5. removing mirrorlist with no valid mirrors: / var/ cache/yum/x86_64/ 6/base/mirrorlist.txt
  6. 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

内容:


  
  1. [base]
  2. name=CentOS- 6
  3. failovermethod=priority
  4. baseurl=http://mirrors.aliyun.com/centos-vault/ 6.5/os/x 86_64/
  5. gpgcheck= 0

测试:


  
  1. [root@openvpn ~] # yum -y install samba samba-common samba-client
  2. Loaded plugins: fastestmirror, refresh-packagekit, security
  3. Loading mirror speeds from cached hostfile
  4. base | 3.7 kB 00:00
  5. base/primary_db | 4.4 MB 01:19
  6. Setting up Install Process
  7. Package samba -3.6 .9 -164.el6.x86_64 already installed and latest version
  8. Package samba-common -3.6 .9 -164.el6.x86_64 already installed and latest version
  9. Package samba- client -3.6 .9 -164.el6.x86_64 already installed and latest version
  10. Nothing to do

 


转载:https://blog.csdn.net/hongkaihua1987/article/details/112311811
查看评论
* 以上用户言论只代表其个人观点,不代表本网站的观点或立场