Skip to content

Instantly share code, notes, and snippets.

@wangxianhe
Last active April 30, 2018 08:35
Show Gist options
  • Save wangxianhe/c2f65a216bd51c2b00f40acf03c53bb3 to your computer and use it in GitHub Desktop.
Save wangxianhe/c2f65a216bd51c2b00f40acf03c53bb3 to your computer and use it in GitHub Desktop.
CentOS7 修改yum源
刚安装的CentOS7自带的yum源不好使,需要换。
# 修改默认yum源为网易的mirrors.163.com
1、首先备份系统自带yum源配置文件。
[root@localhost ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、下载163的yum源配置文件到/etc/yum.repos.d/
[root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
3、运行yum makecache生成缓存,然后就可以使用了。
[root@localhost yum.repos.d]# yum makecache
为了使用yum安装更多的rpm包,建议安装epel-release.noarch这个包。
root@node2 yum.repos.d]# yum install epel-release.noarch
参考链接:
https://blog.csdn.net/inslow/article/details/54177191
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment