CentOS7 使用yum报错:[Errno 14] HTTP Error 404 - Not Found 正在尝试其它镜像。
CentOS镜像下载、VM虚拟机下载
下载地址:www.macfxb.cn
一、问题描述
安装完CentOS7 后 使用yum报错 如下图
二、解决方案
1.查看自己的系统架构
我的是aarch64
uname -m
2. aarch64架构解决方案
1.进入
/etc/yum.repos.d/
目录, 找到文件CentOS-Base.repo
cd /etc/yum.repos.d/
2.编辑文件
CentOS-Base.repo
,然后注释掉
文件中所有内容,起到备份
作用
- 1.注释掉文件全部内容
- 2.添加一下内容,全部添加到文件中
[base]
name=CentOS-$releasever - Base
baseurl=https://mirrors.aliyun.com/centos-altarch/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.aliyun.com/centos-altarch/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.aliyun.com/centos-altarch/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.aliyun.com/centos-altarch/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
- 3.添加完后,保存退出,
执行以下命令
yum clean all
yum makecache
yum update
- 问题解决,可以正常使用了
3. x86_64解决方案
1.进入
/etc/yum.repos.d/
目录, 找到文件CentOS-Base.repo
cd /etc/yum.repos.d/
2.编辑文件
CentOS-Base.repo
,然后注释掉
文件中所有内容,起到备份
作用
- 1.注释掉文件全部内容
- 2.添加一下内容,全部添加到文件中
[base]
name=CentOS-$releasever - Base
baseurl=https://mirrors.aliyun.com/centos-altarch/$releasever/os/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.aliyun.com/centos-altarch/$releasever/updates/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.aliyun.com/centos-altarch/$releasever/extras/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.aliyun.com/centos-altarch/$releasever/centosplus/x86_64/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
- 3.添加完后,保存退出,
执行以下命令
yum clean all
yum makecache
yum update
- 问题解决,可以正常使用了