标签:更改国内源
centos 默认的源是国外的,访问下载的时候有点慢,用国内的源比较方便需要先把原来的源的配置文件删了
rm -f CentOS-Base.repo
用如下两个命令下载yum源,只需要用到一个就可以
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
curl -O http://mirrors.163.com/.help/CentOS7-Base-163.repo
[root@kylin yum.repos.d]# ls
CentOS-CR.repo CentOS7-Base-163.repo
CentOS-Debuginfo.repo dvd.repo
CentOS-Media.repo epel-testing.repo
CentOS-Sources.repo epel.repo
CentOS-Vault.repo wget
CentOS-fasttrack.repo yum.repos.d.bak
用yum list可以查看yum的源
可以试着安装一个包试一下
验证是否是刚才下载的yum源生效
把下载的centos7的名字换成其他的名字在安装包就安装不了。恢复名字就可以安装
[root@kylin yum.repos.d]# mv CentOS7-Base-163.repo CentOS7-Base-163.repo.aa
[root@kylin yum.repos.d]# yum install zsh Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
[root@kylin yum.repos.d]# mv CentOS7-Base-163.repo.aa CentOS7-Base-163.repo
[root@kylin yum.repos.d]# yum clean all
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Cleaning repos: base epel extras updates
Cleaning up everything
Cleaning up list of fastest mirrors
[root@kylin yum.repos.d]# yum install zsh
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
base | 3.6 kB 00:00
epel/x86_64/metalink | 7.2 kB 00:00
epel | 4.3 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
(1/7): base/7/x86_64/group_gz | 155 kB 00:00
(2/7): epel/x86_64/group_gz | 170 kB 00:00
标签:更改国内源
原文地址:http://blog.51cto.com/huazi1991/2083610