CentOs7- replace download source

Replace the default source

Replace Source:

The default source is foreign sources, foreign sources are likely to open more slowly so it is possible to replace open source.

Many domestic manufacturers do we now use a mirror source 163.

http://mirrors.163.com/.help/centos.html

First, backup repo

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

You can view the repo backups

cd /etc/yum.repos.d/                //进入指定目录
ll              //查看命令

repo download the corresponding version Installation CentOS 7 put into /etc/yum.repos.d/CentOS-Base.repo

curl http://mirrors.163.com/.help/CentOS7-Base-163.repo -o CentOS7-Base-163.repo

Run the following command to generate cache

yum clean all             //这条命令如果失败不用管
yum makecache              

If you can not read the command prompt is because yum is occupied we can get rid of him by the following command

rm -f /var/run/yum.pid      //然后在执行 运行下面命令生成缓存 的步骤

After the installation is complete, you can install a source wget installed is not installed

yum install wget                //安装wget

The default installation vim machines have vi, vim vi easier to use than some of

The following is a Linux vim file editing artifact

yum install vim

Modify the source yum Ali

1. 备份本地yum源

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

2.获取阿里yum源配置文件

将https://mirrors.tuna.tsinghua.edu.cn/help/centos/  中的内容粘贴到CentOS-Base.repo

3.更新cache

yum  clean   all

yum makecache 

4.查看

yum -y update 

Guess you like

Origin www.cnblogs.com/i969639/p/11200995.html