首页查找驱动Windows 日常使用数据挖掘与人工智能搜索引擎与SEO技术备忘录站长随笔

Centos 6.X 无法安装gcc,也不能使用yum解决办法

2022-02-15 CentOS 浏览次数:6183
 
最近想在老爷机Centos 6上安装gcc和lnmp,但是发现有以下问题:

Loaded plugins: fastestmirror, security
Setting up Install Process
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

奇怪的是,以前一直都能顺利安装好的,今天怎么就忽然装不上了呢?

查了下资料,网络很多的资料都不对,那些说什么改DNS,改国内源,改桥接模式,都不对的,终于找到一个站长写的正确方法,感谢这位站长:


sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo
yum clean all
yum makecache


然后就可以正常使用yum了,也能正常安装gcc和lnmp了

yum -y install gcc gcc-c++ autoconf automake make

后话:之所以出现这个问题,是因为Centos 6已经被官方抛弃了,但是照顾到一些顽固用户,官方保留了最后一个版本的镜像,只是这个镜像不会再有更新了。

今天是元宵节,祝大家团团圆圆!

留言

有啥想说的就说吧,有啥想问的就问吧
Good good study, day day up!

昵称

Email (填它做啥?国内不兴这玩意,但程序代码里有,我懒得删...)

    ToolBar:

    正在上传图片,请稍等...   

内容  (如果可以的话,最好有相关问题的几张图,特别是出现了错误的时候,当时弹出的错误消息,或者对话框之类的,截图传上来看看吧,这样才好知道具体情况)

查看 HTML 代码(只读模式), 点击返回编辑.

 
最新文章
 
求助
2019 - 2024 mypcrun.com
桂ICP备19002156号-1桂公网安备 45070202000667号
这回把网站设计得那么漂亮,这下子不会被人笑了吧。