Some optimal configuration of Yum source

Time:2021-1-1

Set 163 source
Netease (163) Yum source is one of the best Yum sources in China. Both the speed and software version are very good. Setting Yum source to 163yum can improve the speed of package installation and update, and avoid some common software versions being unable to find. The specific setting method is as follows:
1. Enter the yum source configuration directory

Copy code

The code is as follows:

cd /etc/yum.repos.d

2. Backup the yum source of the system

Copy code

The code is as follows:

mv CentOS-Base.repo CentOS-Base.repo.bk

Download the yum source of 163 Netease:

Copy code

The code is as follows:

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

3. After updating the yum source, execute the following command to update the yum configuration to make the operation take effect immediately

Copy code

The code is as follows:

yum makecache

4. In addition to Netease, there are other good Yum sources in China, such as those from China University of science and technology and Sohu. You can download them according to your own needs
The source of China University of science and technology

Copy code

The code is as follows:

wget http://centos.ustc.edu.cn/CentOS-Base.repo

The yum source of Sohu

Copy code

The code is as follows:

wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo

Theoretically speaking, these Yum source RedHat systems and fedora can also be used, but they have not been tested. The webmasters who need them can test them by themselves.

Using cobbler to build your own Yum source
How to use cobbler:
Enter the cobler interface, click “repos” and create a new repo. I have created four Yum sources. Drop down the options next to go, select “reposync” and check the repo project to synchronize the yum sources.

Cobbler’s principle of creating a Yum source is very simple, which is to synchronize the external Yum source. So when configuring the repo project below, the “mirror” item can fill in the available Yum source. When performing reposync, cobbler will synchronize the external software package.

Here we choose x86 for “arch”_ 64 (64 bit system), select “Yum” for “breed” and external Yum source for “mirror”.

I use Alibaba cloud’s Yum source

Copy code

The code is as follows:

CentOS-Base:http://mirrors.aliyun.com/centos/6/os/x86_64/
CentOS-updates:http://mirrors.aliyun.com/centos/6/updates/x86_64/
CentOS-extras:http://mirrors.aliyun.com/centos/6/extras/x86_64/
Centos-epel:http://mirrors.aiyun.com/epel/6/x86_64/

Due to the large size of the updated software package, I mounted a separate disk and linked it to / var / www / cobbler / repo_ Mirror / (directory of Yum source software)

Copy code

The code is as follows:

#Create a CentOS- Base.repo File (put it in / var / www / cobbler / Ks)_ mirror/mirror_ Name above (mirror)_ Name is the name of the image source you created, so that the server can download and use it.)
[core-0]
name=core
baseurl=http://192.168.6.170/cobbler/ks_mirror/Centos6.4_mini-x86_64/
enabled=1
gpgcheck=0
priority=1

[centos6.4-x86_64-base]
name=centos6.4-x86_64-base
baseurl=http://192.168.6.170/cobbler/repo_mirror/Centos6.4-x86_64-base/
enabled=1
priority=99
gpgcheck=0

[centos6.4-x86_64-updates]
name=centos6.4-x86_64-update
baseurl=http://192.168.6.170/cobbler/repo_mirror/Centos6.4-x86_64-update/
enabled=1
priority=99
gpgcheck=0

[centos6.4-x86_64-extras]
name=centos6.4-x86_64-extras
baseurl=http://192.168.6.170/cobbler/repo_mirror/Centos6.4-x86_64-extras/
enabled=1
priority=99
gpgcheck=0

[centos6.4-x86_64-epel]
name=centos6.4-x86_64-epel
baseurl=http://192.168.6.170/cobbler/repo_mirror/Centos6.4-x86_64-epel/
enabled=1
priority=99
gpgcheck=0

201587194107745.png (1738×502)

201587194239809.png (933×463)

201587194304335.png (1741×538)