CentOS Add common Yum source

Source: Internet
Author: User
Tags gpg

The official CentOS source removes some copyright-related software, so you want to install the software or manually download the installation, or use a different source. Below I recommend the common two sources, these two sources basically can satisfy the general server usage demand.

First , to determine the system architecture and version before adding the source .

To view the system version:

Shell

1

Lsb_release-a

This command is installed on most hosts and will be displayed 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.

Shell

1

Head-1/etc/issue

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

If it is a CentOS system, you can use the following command directly:

Shell

1

Rpm-q Centos-release

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

After that, you determine the system architecture.

Shell

1

Uname-a

Will be shown as follows:
Linux jgh.localdomain 2.6.32-279.5.2.el6.i686 #1 SMP Thu 22:16:48 UTC + i686 i686 i386 gnu/linux

i686, i386 is the architecture of this system.

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, it is recommended to add domestic sources, such as NetEase, Sohu, Zhong Ke, mobile and so on.

Add Remi Source

The Remi source contains a number of software that is updated quickly. Many new versions of the software can be found here the first time. Enter Remi official website to find maintained Enterprise Linux (Rhel/centos/other clones)

Select the appropriate release file according to the system architecture

Shell

1

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, here are the versions of different operating systems available. Click the CentOS wiki on the page to go to the CentOS website (turn around and back), follow the prompts to select the appropriate operating system version, my is CentOS 6, click the jump after the link to see the import, there are two, i686 and x86_64 architecture. I choose i686.

Shell

1

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

The source is added, or it can be added in step, as described on the CentOS web site.

Add EPEL Source

Go to the website and pull down to find how can I use these extra packages? , according to the system architecture and version selected EL6, click, the system will be based on the visiting IP to find the fastest source image, domestic access will usually go to Sohu and Zhong ke source. If you want to use the United States source, you will be using 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

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

Click Репозиторийдляcentos 6 to view the content, pull to the bottom, find установкарепозитория that paragraph, then the following content you should understand, there are several RPM package links, first gave the source of EPEL, Then give the ALT own. 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 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 website, click on the download link on the right, and pull to the bottom to find the pre-built Packages item. Click the link for the mainline version. Follow the prompts to edit the contents of the repo file, as described below.
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

1

2

3

4

5

[Nginx]

Name=nginx Repo

baseurl=http://nginx.org/packages/mainline/centos/6/$basearch/

Gpgcheck=0

Enabled=1

Save exit

update after adding a source Yum

Shell

1

Yum Clean All

Shell

1

Yum Update

finally , need to set the source's management policy

If you prefer to install software from a source first , then the recommended installation yum-priorities Plugins

The purpose of this plugin is to prioritize multiple sources, and when the same software exists in multiple sources, the software is loaded from the highest priority source.

Shell

1

Yum Install Yum-priorities

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

Shell

1

2

3

4

5

P align= ' left ' >6

7

8

9

10

11

12

13

14

15

16

[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 add is complete.

Http://www.cnblogs.com/lidabo/p/3970559.html

CentOS Add common yum source (go)

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.