替换linux系统yum源

在下载yum文件慢的情况下,可以更换DNS或更换yum源

1、备份系统旧配置文件

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、获取对应版本的CentOS-Base.repo 到/etc/yum.repos.d/目录替换之前先备份旧配置

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

centos各版本的源配置列表centos5

wget -O /etc/yum.repos.d/CentOS-Base.repohttp://mirrors.cloud.tencent.com/repo/centos5_base.repo

centos6

wget -O /etc/yum.repos.d/CentOS-Base.repohttp://mirrors.cloud.tencent.com/repo/centos6_base.repo

centos7(腾讯yum源)

wget -O /etc/yum.repos.d/CentOS-Base.repohttp://mirrors.cloud.tencent.com/repo/centos7_base.repo(阿里云yum源)wget -O /etc/yum.repos.d/CentOS-Base.repohttp://mirrors.aliyun.com/repo/Centos-7.repo

更新缓存

yum clean allyum makecache

Published by

风君子

独自遨游何稽首 揭天掀地慰生平

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注