华为云yum镜像源超慢改用阿里云镜像遇坑解决方法
又是深夜了,晚上搞了一台华为云的云服务器(哦不是是昨天晚上),本来想着是华为本身就是做服务器的,所以在众多大厂选择了华为,可偏偏下载个上传下载命令都不得,任何命令都是蜗牛,然后心里很不爽,怪不得阿里云份额能超过你们几个大厂总和,算了,不吐槽了,百度一番直接去改了阿里云的镜像源,步骤如下:
一、备份原来的镜像源(其实没必要)
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
二、下载阿里云的镜像
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
三、清除yum缓存并重新生成缓存
yum clean all
yum makecache
本来想的是万事大吉,可是偏偏makecache都慢的要死,反正是没解决问题,然后注意到了一个叫做什么epel对应的mirror怎么还是日本的,想想就觉得不对,具体样子如下:
[root@hw yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Determining fastest mirrors
epel/x86_64/metalink
* base: mirrors.aliyun.com
* epel: ftp.jaist.ac.jp
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
注意红色部分,然后就找度娘,各种yum epel的找,终于找到了解决办法,不知道是不是解决办法,反正下载变的像aliyun一样快了
四、添加阿里云的epel镜像源:
wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
然后再去 yum clean all 、 yum makecache 以下,正常了。。,哎,睡眠时间总是不够。。。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)