yum/wget 下载慢原因
系统默认的下载源是国外源,如果没有科学上网的话,网速会受到很大的限制,因此解决方案是将下载源更换成国内的阿里源。
操作步骤
- 首先备份系统自带『yum源配置文件』,具体路径为:
/etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
- 下载阿里云的yum源配置文件到文件夹『/etc/yum.repos.d/』中。
注意:
- 不同的 CentOS 版本对应不同的文件,选下面一条执行即可;
- 如果 wget 命令不生效,说明还没有安装 wget ,需要执行命令
yum -y install wget
进行安装。
# 各系统版本repo文件对应的下载操作
# CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
# CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
# CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
- 清除 yum 缓存
yum clean all
- 生成新的缓存
yum makecache
最后
以上就是飞快泥猴桃最近收集整理的关于CentOS 更换阿里源解决 yum/wget 下载慢的问题的全部内容,更多相关CentOS内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复