admin管理员组文章数量:1026683
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/repo/Centos-5.repo
# CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun/repo/Centos-6.repo
# CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun/repo/Centos-7.repo
- 清除 yum 缓存
yum clean all
- 生成新的缓存
yum makecache
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/repo/Centos-5.repo
# CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun/repo/Centos-6.repo
# CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun/repo/Centos-7.repo
- 清除 yum 缓存
yum clean all
- 生成新的缓存
yum makecache
版权声明:本文标题:CentOS 更换阿里源解决 yumwget 下载慢的问题 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/jiaocheng/1729170628a945284.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论