Linux (CentOS 7.4) replace yum with domestic source

   yum is a mirror library of system installation tools and application plug-ins for some versions of linux (centOS, redhat) (it can be understood as an FTP server that stores plug-ins and applications). Different versions of the system may have different default yum libraries. There are also good yum sources in China such as NetEase, University of Science and Technology of China and Sohu. Using the domestic yum source is fast, and NetEase's resource update and completeness are good (China University of Science and Technology and Sohu can also). Then this article will introduce how to update the yum source of the system.

1. Backup the original yum configuration source

     Go to /etc/yum.repos.d and execute mv CentOS-Base.repo CentOS-Base.repo.bak to back up the original yum source.

2. Download the new yum configuration source (pay attention to downloading the version compatible with the system)

        wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

    This instruction is to download the corresponding repo file directly from the Internet. System networking is required. If the system cannot access the Internet, you can also download the repo file from the Internet and upload it to the system /etc/yum.repos.d path.

    ps: View the system version command: lsb_release -a

            If the system does not have lsb installed, run the command first: yum install -y redhat-lsb to install lsb.

       If the system does not have wget installed, install it through the above command.

3. Set the downloaded yum source as the default yum source

     sudo mv CentOS6-Base-163.repo CentOS-Base.repo

Fourth, run yum makecache to generate the cache.

       yum clean all

       yum makecache


The above are the complete steps to replace the yum source. Record it.



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325949010&siteId=291194637