Introduction of CentOS Adding common yum source method

Source: Internet
Author: User
Tags gpg centos

Entos's official source removed some copyright-related software, so you want to install the software or download the installation manually, or use a different source. I recommend the two commonly used sources, which can basically meet the needs of the general server.
First, you need to determine the system architecture and version before adding the source.

To view the system version:

Lsb_release-a

This command is installed on most hosts and will be shown as follows:
LSB Version:: Core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch distributor Id:centos Descripqion : CentOS Release 5.3 (Final) release:5.3 codename:final

If Lsb_release is not installed, you can also use the following command.


Head-1/etc/issue

Will be shown as follows:
CentOS Release 6.3 (Final)

If the CentOS system can use the following commands directly:


Rpm-q Centos-release

Will be shown as follows:
centos-release-6-3.el6.centos.9.i686

After that, you determine the system architecture.


Uname-a

Will be shown as follows:
Linux jgh.localdomain 2.6.32-279.5.2.el6.i686 #1 SMP Thu Aug 22:16:48 UTC-i686 i686

i686, i386 is the architecture of this system.
When you know the system version and schema, you can find the corresponding file import in the source.

Here are a few sources, Remi, Rpmforge, Epel, Centalt, webtatic, Nginx If you are using the domestic host, suggest adding domestic sources, such as NetEase, Sohu, USTC, mobile and so on.
Add Remi Source

The Remi source contains a lot of software, and it's very fast to update. Many new versions of the software can be found here the first time. Go to Remi website and find maintained Enterprise Linux (Rhel/centos/other clones)

Select the appropriate release file according to the system architecture


RPM-IVH http://rpms.famillecollet.com/enterprise/remi-release-6.rpm


Add Rpmforge Source

First go to the Rpmforge Web site to find use Help, which provides a different version of the operating system. Click on the page CentOS wiki to go to the CentOS official website (Turn round and back again), according to the prompts to select the corresponding operating system version, my is CentOS 6, click on the jump saw the import link, there are two, i686 and x86_64 architecture. I choose i686.


RPM-IVH http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm

The source is added, or you can follow the instructions on the CentOS Web site to add it step-by-step.
Add Epel Source

Go to the website and pull down to find how can I use these extra packages? Items, according to the system architecture and version of the selected EL6, click, the system will be based on visiting IP to find the fastest source mirror, the domestic visit will usually go to the source of Sohu and USTC. If you want to use the U.S. source, you need to use proxy access, my return to http://dl.fedoraproject.org/pub/ epel/6/i386/epel-release-6-8.noarch.rpm


RPM-IVH http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

Add Centalt Source

Access to the site, in the right category to find Ссылки, although it is Russian, but also difficult not to pour me, oh, in fact, we students learn Russian, but all returned to the teacher, Khan a ..., then you will see Репозиторийдляcentos 6, this is the CentOS 6 Library, if you are CentOS 5 then choose one, if you want to go to the list to find the point просмотррепозиторияcentalt.

Click Репозиторийдляcentos 6 to view the content, pull to the bottom, find установкарепозитория that paragraph, and then you should understand the following content, there are several RPM links, first given the source of the Epel, and then give a LT's own. Find the import you need. Ok.


RPM-IVH http://centos.alt.ru/pub/repository/centos/6/i386/centalt-release-6-1.noarch.rpm

Add PHP Source

Go to webtatic.com and find the Centos/rhel 6 source and add it.


RPM-UVH http://mirror.webtatic.com/yum/el6/latest.rpm


Add Nginx Source

Into the Nginx official website, point to the right of the download link, pull to the bottom to find the pre-built Packages. Point mainline version of the link. According to the prompts to edit the contents of the repo file, the following actions.
Create a new Nginx.repo file in the Yum repo directory


Vi/etc/yum.repos.d/nginx.repo

Enter the following content


[Nginx]
Name=nginx Repo
baseurl=http://nginx.org/packages/mainline/centos/6/$basearch/
Gpgcheck=0
Enabled=1

Save exit
Update Yum after adding source



Yum Clean All



Yum Update

Finally, you need to set the source management policy
If you prefer to install software from a source, it is recommended that you install the Yum-priorities plugin

The role of this plug-in is to prioritize multiple sources, and when the same software exists in multiple sources, the software will be installed from the highest priority source.


Yum Install Yum-priorities

After installation, you need to set up the. Repo related files (such as Centos-base.repo) in the/etc/yum.repos.d/directory to insert sequential instructions in these files: Priority=n (N is a positive integer of 1 to 99, the smaller the value is the higher the priority), for example:


[Base]
name=centos-$releasever –base
mirrorlist=http://mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo=os
#baseurl =http://mirror.centos.org/centos/$releasever/os/$basearch/
Gpgcheck=1
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-5
Priority=1

#released Updates
[Updates]
name=centos-$releasever –updates
mirrorlist=http://mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo=updates
#baseurl =http://mirror.centos.org/centos/$releasever/updates/$basearch/
Gpgcheck=1
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-5
Priority=1

At this point, the source addition is complete.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.