centos 7 yum安装失败(HTTP Error 404 - Not Found)的解决方法

简介: centos 7 yum安装失败(HTTP Error 404 - Not Found)的解决方法

一、问题描述



使用yum install vim时,出现HTTP Error 404 - Not Found的提示,具体如下:


http://mirrors.aliyun.com/non-supported/rhel/7/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found


二、解决办法



解决思路就是卸载重新安装,具体流程如下:


  1. 删除老仓库文件
# 进入yum
cd /etc/yum.repos.d
# 移除
rm *.*


  1. 卸载yum包
# 查看yum版本
[root@192 yum.repos.d]# rpm -qa yum
yum-3.4.3-168.el7.centos.noarch
# 卸载yum安装包
rpm -qa yum yum-3.4.3-168.el7.centos.noarch
# 卸载安装组件
rpm -qa | grep yum | xargs rpm -e --nodeps 
rpm -qa yum


  1. 下载最新的rpm包,在http://mirrors.163.com/centos/7/os/x86_64/Packages/ 目录下找出最新的rpm包,并下载


yum-最新版.centos.noarch.rpm 
yum-metadata-parser-最新版.x86_64.rpm
yum-plugin-fastestmirror-最新版.noarch.rpm
wget-最新版.x86_64.rpm


  1. 将下载的安装包上传到任意文件夹 ,我使用的是WinSCP,将文件拖曳到指定的linux文件夹里面即可。

  2. 安装yum
rpm -ivh yum-*


  1. 安装wget
rpm -ivh wget-*


  1. 导入证书
rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7


  1. 添加阿里的源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo


  1. 清除缓存 生成新的缓存
yum clean all
yum makecache


目录
相关文章
|
1月前
|
安全 关系型数据库 应用服务中间件
Envoy 开启 HTTP2 后偶现 404 解决方法
在大部分基于 Envoy 实现的网关里,都存在这样一个问题,当开启 http2 时,客户端访问会出现偶发的 404,并且可以从日志注意到这些 404 的请求,:authority 头里的域名和 SNI 里的域名不一致。且在使用泛域名证书,且配置了多个域名的路由的情况下,这个问题特别容易出现。
|
3月前
|
前端开发 JavaScript 数据库
https页面加载http资源的解决方法
https页面加载http资源的解决方法
87 5
|
8月前
|
安全 网络协议 Linux
yum出现Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile解决方法
yum出现Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile解决方法
785 3
|
3月前
|
前端开发 JavaScript 数据库
https页面加载http资源的解决方法
https页面加载http资源的解决方法
106 4
|
5月前
|
前端开发 JavaScript 数据库
https页面加载http资源的解决方法
https页面加载http资源的解决方法
244 7
|
9月前
|
缓存 负载均衡 应用服务中间件
如何在 CentOS 7 上为 NGINX 安装开源 HTTP 加速器:Varnish
如何在 CentOS 7 上为 NGINX 安装开源 HTTP 加速器:Varnish
211 1
如何在 CentOS 7 上为 NGINX 安装开源 HTTP 加速器:Varnish
|
5月前
|
缓存 Linux 开发工具
CentOS7 安装KDE报错的解决方法:Loaded plugins:fastestmirror,langpacks There is no installed group.
CentOS7 安装KDE报错的解决方法:Loaded plugins:fastestmirror,langpacks There is no installed group.
227 0
|
5月前
|
Linux 开发工具 数据安全/隐私保护
CentOS7报错:“xxx is not in the sudoers file. This incident will be reported“解决方法
CentOS7报错:“xxx is not in the sudoers file. This incident will be reported“解决方法
492 0
|
7月前
|
缓存 Linux
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stoc
CentOS 默认的镜像源可能无法访问。可以更换为其他镜像源,例如阿里云、腾讯云等。
670 7
|
6月前
|
API 开发工具 Python
【Azure Developer】使用 Azure Python SDK时,遇见 The resource principal named https://management.azure.com was not found in the tenant China Azure问题的解决办法
【Azure Developer】使用 Azure Python SDK时,遇见 The resource principal named https://management.azure.com was not found in the tenant China Azure问题的解决办法