栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

centos 6 yum源不可用安装报YumRepo Error: All mirror URLs are not using ftp, http[s] or file

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

centos 6 yum源不可用安装报YumRepo Error: All mirror URLs are not using ftp, http[s] or file

cat /etc/redhat-release查看版本
vim /etc/yum.repos.d/CentOS-base.repo
(可以先提前备份一下)
内容清空
将下面代码6.5改成自己的版本复制进去
(此处使用的是国外源,若使用国内源,请往下看)

[base]
name=CentOS-6.5 - base
#mirrorlist=http://#mirrorlist.centos.org/?release=6.5&arch=$basearch&repo=os
baseurl=https://archive.kernel.org/centos-vault/6.5/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#released updates 
[updates]
name=CentOS-6.5 - Updates
#mirrorlist=http://#mirrorlist.centos.org/?release=6.5&arch=$basearch&repo=updates
baseurl=https://archive.kernel.org/centos-vault/6.5/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-6.5 - Extras
#mirrorlist=http://#mirrorlist.centos.org/?release=6.5&arch=$basearch&repo=extras
baseurl=https://archive.kernel.org/centos-vault/6.5/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6.5 - Plus
#mirrorlist=http://#mirrorlist.centos.org/?release=6.5&arch=$basearch&repo=centosplus
baseurl=https://archive.kernel.org/centos-vault/6.5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-6.5 - Contrib
#mirrorlist=http://#mirrorlist.centos.org/?release=6.5&arch=$basearch&repo=contrib
baseurl=https://archive.kernel.org/centos-vault/6.5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

清理缓存 
 # yum clean all  
 更新缓存
 # yum makecache
 #测试
 yum install -y unzip zip

由于比较慢
可以使用163 centos7的yum源

[base]
name=CentOS-7 - base - 163.com
baseurl=http://mirrors.163.com/centos/7/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=7&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#released updates 
[updates]
name=CentOS-7 - Updates - 163.com
baseurl=http://mirrors.163.com/centos/7/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=7&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-7 - Extras - 163.com
baseurl=http://mirrors.163.com/centos/7/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=7&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-7 - Plus - 163.com
baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=7&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-7 - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/7/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=7&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

参考:https://blog.csdn.net/weixin_44160584/article/details/110872926

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/509792.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号