Some copyright-related software is removed from the official sources of centos. Therefore, you want to install the software, download it manually, or use other sources. below I recommend two common sources, which can basically meet the needs of General servers.
First, determine the system architecture and version before adding the source.
View the system version:
Shell
This command is installed on most hosts and is displayed as follows:
LSB version: core-3.1-ia32: core-3.1-noarch: graphics-3.1-ia32: distributor ID: centos descripqion: centos release 5.3 (final) Release: 5.3 codename: Final
If lsb_release is not installed, use the following command.
Shell
The following figure is displayed:
Centos release 6.3 (final)
For centos, run the following command:
Shell
The following figure is displayed:
Centos-release-6-3.el6.centos.9.i686
Then, determine the system architecture.
Shell
The following figure is displayed:
Linux jgh. localdomain 2.6.32-279.5.2.el6.i686 #1 SMP Thu Aug 23 22:16:48 UTC 2012 i686 i686 i386 GNU/Linux
I686 and i386 are the architecture of this system.
Once you understand the system version and architecture, you can find the corresponding file import in the source.
Here we will introduce several sources, such as Remi, rpmforge, epel, centalt, webtatic, and nginx. If you are using a domestic host, we recommend that you add a domestic source, such as Netease, Sohu, MIIT, and China Mobile.
Add Remi Source
The Remi source contains a large number of software and its update speed is very fast. Many new versions of software can be found here immediately. Go to the Remi official website and find the maintained Enterprise Linux (RHEL/centos/other clones) item
Select the corresponding release file based on the system architecture
Shell
1 |
Rpm-IVH http://rpms.famillecollet.com/enterprise/remi-release-6.rpm |
Add rpmforge Source
First, go to the rpmforge website to find help. Here we provide versions of different operating systems. click centos wiki on the page to go to The centos official website (turn around again), and select the corresponding OS version as prompted. My version is centos 6, click to jump and you will see the import link, which has two i686 and x86_64 architectures. I chose i686.
Shell
1 |
Rpm-IVH http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm |
The source has been added. You can also add it step by step according to the instructions on the centos website.
Add an epel Source
Go to the website and pull down. How can I use these extra packages? Item. Select el6 based on the system architecture and version. Click. The system will find the fastest source Image Based on the IP address. Domestic access will usually go to the source of Sohu and HKUST. if you want to use us source, you need to use proxy access, my return http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
Shell
1 |
Rpm-IVH http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm |
Add centalt Source
Go to the website and find our students in the right-hand category. Although it is Russian, it is difficult to find it. Haha, in fact, we learned Russian in our student age, but I gave it back to my teacher, Khan ...... Next, we will see zookeeper centos 6, which is the database of centos 6. If you are centos 5, select the first one, if you want to find it in the list by yourself, click "too many" and then click "too many.
Click р е п cencen6 6 6 6 д cencencencentos 6 to view the content.When there are too many threads, there are too many threads, too many threads.In that section, you should have understood the following content. Below are links to several RPM packages. The source of epel is given first, and then the source of ALT is given. find the import you need. OK.
Shell
1 |
Rpm-IVH http://centos.alt.ru/pub/repository/centos/6/i386/centalt-release-6-1.noarch.rpm |
Add a PHP Source
Go to webtatic.com, find the centos/RHEL 6 source, and add it.
Shell
1 |
Rpm-uvh http://mirror.webtatic.com/yum/el6/latest.rpm |
Add nginx Source
Go to the nginx official website, click the download link on the right, and find the pre-built packages item at the bottom. Click the link of mainline version. Edit the repo file as prompted. The specific operations are as follows.
Create a new nginx. Repo file in the yum repo directory
Shell
1 |
VI/etc/yum. Repos. d/nginx. Repo |
Enter the following content
Shell
12345 |
[Nginx] Name = nginx repobaseurl = http://nginx.org/packages/mainline/centos/6/?basearch/gpgcheck=0enabled=1 |
Save and exit
Update Yum after adding the source
Shell
Shell
Finally, you need to set the source management policy. If you prefer to install software from a source first, we recommend that you install the Yum-priorities plug-in.
This plug-in is used to prioritize multiple sources. When the same software exists in multiple sources, the software is installed from the source with the highest priority.
Shell
1 |
Yum install Yum-Priorities |
After installation, you need to set/etc/yum. repos. d/directory. repo-related files, such as CentOS-Base.repo, insert the sequence directive in these files: Priority = n (n is a positive integer from 1 to 99, the smaller the value, the higher the priority), for example:
Shell
12345678910111213141516 |
[Base] Name = centos-$ releasever-basemirrorlist = http://mirrorlist.CentOS.org /? Release = $ releasever & arch = $ basearch & repo = OS # baseurl = repository # released updates [updates] Name = centos-$ releasever-updatesmirrorlist = http://mirrorlist.CentOS.org /? Release = $ releasever & arch = $ basearch & repo = updates # baseurl = Signature |
Now, the source is added.
Add common Yum sources to centos