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

关于yum安装与更换镜像源

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

关于yum安装与更换镜像源

[root@localhost Downloads]# rpm -qa | grep yum
yum-3.2.29-40.el6.centos.noarch
yum-metadata-parser-1.1.2-16.el6.x86_64
yum-plugin-security-1.1.30-14.el6.noarch
PackageKit-yum-plugin-0.5.8-21.el6.x86_64
yum-utils-1.1.30-14.el6.noarch
yum-plugin-fastestmirror-1.1.30-14.el6.noarch
PackageKit-yum-0.5.8-21.el6.x86_64

查看系统是否带有yum: https://blog.csdn.net/taokai_110/article/details/72899182
重装:https://www.cnblogs.com/wushaoliang/p/14756374.html
wget + tar 源码安装https://www.cnblogs.com/jukaiit/p/8877975.html

[root@localhost Downloads]# yum install zstd
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
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 find a valid baseurl for repo: base
[root@localhost Downloads]# yum install gcc
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
https://vault.centos.org/6.5/os/x86_64/repodata/repomd.xml: [Errno 14] problem making ssl connection
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

ssl 证书问题:

  1. 点开报错的链接,若打不开,需修改baseurl,然而我能打开该链接;
  2. 修改 epel.repo 文件配置:
[root@localhost etc]# find / -name epel.repo
[root@localhost etc]# 

然而我没有该文件。我的centO对整个系统的源管理配置文件在 etc/yum.repo.d/CentOS-base.repo

备份:

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

换为国内镜像源:

https://blog.csdn.net/wudinaniya/article/details/105758739

[root@localhost yum.repos.d]# vim CentOS-base.repo   // 把mirrorlist 的注释全打开
[root@localhost yum.repos.d]# yum install gcc
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/repo/arch combination/
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/repo/arch combination/
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/repo/arch combination/
https://vault.centos.org/6.5/os/x86_64/repodata/repomd.xml: [Errno 14] problem making ssl connection
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
[root@localhost yum.repos.d]# vim CentOS-base.repo     // mirrorlist注释打开,baseurl 注释起来
[root@localhost yum.repos.d]# yum install gcc
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
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 find a valid baseurl for repo: base

各种试都报错,后边才发现CentOS已经EOL了:

  1. https://zhuanlan.zhihu.com/p/337075432
  2. https://zhuanlan.zhihu.com/p/341770501

替换方案:

https://blog.csdn.net/qq_32482645/article/details/111288186

使用 http://vault.centos.org 作为更新源
CentOS官方:http://vault.centos.org/
阿里云镜像:http://mirrors.aliyun.com/centos-vault/

具体的操作步骤如下:
1、关闭fastestmirror

vi /etc/yum/pluginconf.d/fastestmirror.conf
#修改参数
enable=0

2、将原来的源改名,习惯备份

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

3、更换源

#替换为官方Vault源
wget -O /etc/yum.repos.d/CentOS-base.repo http://allen-hz-bucket.oss-cn-hangzhou.aliyuncs.com/centos/Centos-6-Vault-Official.repo
#或者
curl -o /etc/yum.repos.d/CentOS-base.repo http://allen-hz-bucket.oss-cn-hangzhou.aliyuncs.com/centos/Centos-6-Vault-Official.repo

#替换为阿里云Vault镜像
wget -O /etc/yum.repos.d/CentOS-base.repo http://allen-hz-bucket.oss-cn-hangzhou.aliyuncs.com/centos/Centos-6-Vault-Aliyun.repo
#或者
curl -o /etc/yum.repos.d/CentOS-base.repo http://allen-hz-bucket.oss-cn-hangzhou.aliyuncs.com/centos/Centos-6-Vault-Aliyun.repo

#替换之后运行 yum makecache 生成缓存
yum clean metadata
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/641831.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

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

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