centos7配置网络yum源

配置网络yum源:        

         1.备份原始yum源:

                   cd   /etc/yum.repos.d

                   mv  CentOS-Base.rpeo   CentOS-Base.repo.bak

         2.配置CentOS的DNS:

                   vim   /etc/resolv.conf

                   nameserver   114.114.114.114         //国内dns

                   nameserver   8.8.8.8                        //国外dns

         3.下载yum文件,替代原始yum源:

                   (1)网易yum源:

                            wget  -O   /etc/yum.repos.d/CentOS-Base.repo    http://mirrors.163.com/.help/CentOS7-Base-163.repo

                            yum   clean   all            //清除缓存

                            yum   makecache       //生成缓存

                            解析:wget -o,使用“-o”参数来指定一个文件名

                   (2)阿里云yum源:

                            wget   -O   /etc/yum.repos.d/CentOS-Base.repo    http://mirrors.aliyun.com/repo/Centos-7.repo

                            yum   clean  all

                            yum   makecache

你可能感兴趣的:(centos7配置网络yum源)