原文网址:https://www.youyong.top/article/1158e029e94b
Aliyun Linux 5.7 64 位系统在安装 gcc 时出现类似如下报错信息: http://mirrors.aliyun.com/centos/%24releasever/addons/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found Trying other mirror.
原文网址:https://www.youyong.top/article/1158e029e94b
Aliyun Linux 5.7 64 位系统在安装 gcc 时出现类似如下报错信息: http://mirrors.aliyun.com/centos/%24releasever/addons/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found Trying other mirror.
原文网址:https://www.youyong.top/article/1158e029e94b
从报错内容可以判断出来是通过指定链接地址,没有找到文件导致的,修改 yum 安装源,通常能够解决找不到安装文件的问题。
1、导入 CentOS-5 的 GPG 证书
rpm --import http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-5
2、让 yum 使用其它第三方软件源:
$ cd /etc/yum.repos.d/
$ wget http://mirrors.163.com/.help/CentOS-Base-163.repo
3、修改 repo 文件
在所有 mirrorlist 前面加上 #,把所有 $releasever 替换成 5,保存:
$ sed -i '/mirrorlist/d' CentOS-Base-163.repo
$ sed -i 's/\$releasever/5/' CentOS-Base-163.repo
4、清理并重新生成 yum 缓存
$ yum clean metadata
$ yum makecache
5、操作完毕后重新 yum 安装 gcc 即可。
$ yum -y install gcc
共 0 条留言