[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 证书问题:
- 点开报错的链接,若打不开,需修改baseurl,然而我能打开该链接;
- 修改 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了:
- https://zhuanlan.zhihu.com/p/337075432
- 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



