Upgrade CentOS6yum source to support more rpm packages (using third-party software libraries EPEL, RPMForge, and RPMFusion)

Source: Internet
Author: User
Tags metalink
When running yuminstallflash-plugin or yuminstallmplayer in CentOS, why can't I find this software in the prompt library? Why? Because CentOS is compiled by RHEL, it removes all copyright issues. Therefore, in the absence of third-party software...

When running yum install flash-plugin or yum install mplayer in CentOS, why is this software not found in the prompt library? Why? Because CentOS is compiled by RHEL, it removes all copyright issues. Therefore, many software cannot be directly installed using yum install without using a third-party software library.

 

The EPEL (Extra Packages for Enterprise Linux) software library provides a re-compiled Fedora component for the RHEL series (4.x, 5.x, 6.x, etc. This software library has worked hard without replacing system components. In some cases, it tries to solve the problem of CentOS compatibility directly, but it firmly denies the compatibility between software libraries as one of the goals. When it is used together with other third-party software libraries, problems may occur. Therefore, when you use EPEL, especially when you use components of other component libraries, make sure that you use the yum Priorities plug-in.

 

The RPMForge library now has more than 10000 CentOS software packages, which is considered by the CentOS community as the safest and most stable third-party software library.

 

The following describes how to use EPEL, RPMForge, and RPMFusion software repositories:

 

1. install the yum-priorities plugin.

 

This plug-in is used to set the order in which yum calls the software source. Because the official software sources are relatively stable and recommended. Therefore, the order of the official source is higher than that of the third source. To ensure this order, you need to install the yum-priorities plug-in.

 

[Root @ CentOS ~] # Yum install yum-priorities

 

After installation, you need to set/etc/yum. repos. d/directory. repo-related files, such as CentOS-Base.repo, insert sequence instructions in these files: priority = N (N is a positive integer from 1 to 99, the smaller the value, the higher priority ), the general configuration is as follows:

[Base], [addons], [updates], [extras]… Priority = 1

[CentOSplus], [contrib]… Priority = 2

Third-party software Source: priority = N (N> 10 recommended)

 

For example, my CentOS-Base.repo configuration is (CentOS 6.0 ):

# CentOS-Base.repo

#

# The mirror system uses the connecting IP address of the client and

# Update status of each mirror to pick mirrors that are updated to and

# Geographically close to the client. You shoshould use this for CentOS updates

# Unless you are manually picking other mirrors.

#

# If the specified list = does not work for you, as a fall back you can try

# Remarked out baseurl = line instead.

#

#

[Base]

Name = CentOS-$ releasever-Base

Using list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = OS

# Baseurl = http://developer.centos.org/centos/?releasever/ OS /?basearch/

Gpgcheck = 1

Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

Priority = 1

 

# Released updates

[Updates]

Name = CentOS-$ releasever-Updates

Using list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = updates

# Baseurl = http://developer.centos.org/centos/?releasever/updates/?basearch/

Gpgcheck = 1

Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

Priority = 1

 

# Packages used/produced in the build but not released

[Addons]

Name = CentOS-$ releasever-Addons

Using list = http://mirrorlist.CentOS.org /? Release = $ releasever & arch = $ basearch & repo = addons

# Baseurl = http://developer.centos.org/centos/?releasever/addons/?basearch/

Gpgcheck = 1

Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

Priority = 1

 

# Additional packages that may be useful

[Extras]

Name = CentOS-$ releasever-Extras

Using list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = extras

# Baseurl = http://developer.centos.org/centos/?releasever/extras/?basearch/

Gpgcheck = 1

Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

Priority = 1

 

# Additional packages that extend functionality of existing packages

[Centosplus]

Name = CentOS-$ releasever-Plus

Using list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = centosplus

# Baseurl = http://developer.centos.org/centos/?releasever/centosplus/?basearch/

Gpgcheck = 1

Enabled = 0

Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

Priority = 2

 

# Contrib-packages by Centos Users

[Contrib]

Name = CentOS-$ releasever-Contrib

Using list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = contrib

# Baseurl = http://developer.centos.org/centos/?releasever/contrib/?basearch/

Gpgcheck = 1

Enabled = 0

Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

Priority = 2

 

2. download and install the EPEL rpm Package

 

1. download and install the EPEL rpm Package

 

32-bit system

[Root @ CentOS ~] # Rpm-ivh http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm

 

64-bit system

[Root @ CentOS ~] # Rpm-ivh http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm

 

If you do not know your system kernel, run the uname-a command to view your kernel information.

 

2. import the PGP Key of the DAG

 

[Root @ CentOS ~] # Rpm -- import/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

 

3. set the source level in the/etc/yum. repos. d/epel. repo file to add priority = 11.

For example, the content of my epel. repo file:

[Epel]

Name = Extra Packages for Enterprise Linux 6-$ basearch

# Baseurl = http://download.fedoraproject.org/pub/epel/6/?basearch

Using list = https://mirrors.fedoraproject.org/metalink? Epel-6 & arch = $ basearch

Failovermethod = priority

Enabled = 1

Gpgcheck = 1

Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

Priority = 11

 

[Epel-debuginfo]

Name = Extra Packages for Enterprise Linux 6-$ basearch-Debug

# Baseurl = http://download.fedoraproject.org/pub/epel/6/$basearch/debug

Using list = https://mirrors.fedoraproject.org/metalink? Epel-debug-6 & arch = $ basearch

Failovermethod = priority

Enabled = 0

Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

Gpgcheck = 1

 

[Epel-source]

Name = Extra Packages for Enterprise Linux 6-$ basearch-Source

# Baseurl = http://download.fedoraproject.org/pub/epel/6/SRPMS

Using list = https://mirrors.fedoraproject.org/metalink? Epel-source-6 & arch = $ basearch

Failovermethod = priority

Enabled = 0

Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

Gpgcheck = 1

 

3. download and install the rpmforge rpm Package

 

1. download the rpmforge rpm file package

 

32-bit system

[Root @ CentOS ~] # Wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm

 

64-bit system

[Root @ CentOS ~] # Wget rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

 

2. install the PGP Key of the DAG

 

[Root @ CentOS ~] # Rpm -- import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

 

3. verify rpmforge's rpm file package

 

[Root @ CentOS ~] # Rpm-K rpmforge-release-0.5.2-2.el6.rf. *. rpm

If the error XXX not an rpm package is reported, check whether the package downloaded by wget is incomplete and the package size is 12 kB.

 

4. install rpmforge's rpm Package

 

[Root @ CentOS ~] # Rpm-ivh rpmforge-release-0.5.2-2.el6.rf. *. rpm

 

5. set the source level in the/etc/yum. repos. d/rpmforge. repo file, that is, add priority = 12, such as the content of my rpmforge. repo file:

### Name: RPMforge RPM Repository for RHEL 6-dag

### URL: http://rpmforge.net/

[Rpmforge]

Name = RHEL $ releasever-RPMforge.net-dag

Baseurl = http://apt.sw.be/redhat/el6/en/?basearch/rpmforge

Using list = http://apt.sw.be/redhat/el6/en/mirrors-rpmforge

# Prepare list = file: // etc/yum. repos. d/mirrors-rpmforge

Enabled = 1

Protect = 0

Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag

Gpgcheck = 1

Priority = 12

 

[Rpmforge-extras]

Name = RHEL $ releasever-RPMforge.net-extras

Baseurl = http://apt.sw.be/redhat/el6/en/?basearch/extras

Using list = http://apt.sw.be/redhat/el6/en/mirrors-rpmforge-extras

# Configure list = file: // etc/yum. repos. d/mirrors-rpmforge-extras

Enabled = 0

Protect = 0

Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag

Gpgcheck = 1

 

[Rpmforge-testing]

Name = RHEL $ releasever-RPMforge.net-testing

Baseurl = http://apt.sw.be/redhat/el6/en/?basearch/testing

Using list = http://apt.sw.be/redhat/el6/en/mirrors-rpmforge-testing

# Prepare list = file: // etc/yum. repos. d/mirrors-rpmforge-testing

Enabled = 0

Protect = 0

Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag

Gpgcheck = 1

 

4. download and install the rpmfusion rpm Package

 

(CentOS officially said that the software in this software library is not as stable as rpmforge! Rpmfusion official site: http://rpmfusion.org)

 

[Root @ CentOS ~] # Rpm-Uvh http://download1.rpmfusion.org/free/el/updates/testing/6/i386/rpmfusion-free-release-6-0.1.noarch.rpm

 

[Root @ CentOS ~] # Rpm-Uvh http://download1.rpmfusion.org/nonfree/el/updates/testing/5/i386/rpmfusion-nonfree-release-5-0.1.noarch.rpm

 

V. test

 

1. test and upgrade

 

[Root @ CentOS ~] # Yum check-update

 

The output information should have the following two rows:

 

Loading "priorities" plugin

...

XX packages excluded due to repository priority protections

 

2. test whether the plug-ins take effect

 

[Root @ CentOS ~] # Yum check-update

If the following output is displayed, the configuration is successful.

Loaded plugins: fastestmirror, priorities, refresh-packagekit

Loading mirror speeds from cached hostfile

The following is a long list of software. The last column is shown in the following figure:

Epel

Rpmforge

Base

The source of each software package.

 

Note:

1. if an error similar to the following occurs during yum usage, most of the reasons are that the rpmfusion server cannot be connected. you can ignore it or set/etc/yum. repo. in the d/directory, change enable = 1 in the repo file related to rpmfusion to 0, and turn off the source list related to rpmfusion.

YumRepo Error: All mirror URLs are not using ftp, http [s] or file.

Eg. script/

 

2. rpmfusion will also see errors similar to the following:

Error: Cannot retrieve repository metadata (repomd. xml) for repository: rpmfusion-foo. Please verify its path and try again

The reason is derived from begin:

Yum cannot connect to the RPM Fusion servers if you get abve message. that cocould be a problem with your local network or a problem with the same manager servers from RPM Fusion. if it's the latter use this comment to temporary work around the problem:

The method is to remove all baseurl and list before # as follows:

Su-c "sed-I's | ^ # baseurl |; s | ^ sort list | # sort list | '/etc/yum. repos. d/rpmfusion * free * repo"

 

To undo the change later use this command:

Su-c "sed-I's | ^ baseurl | # baseurl |; s | ^ # Your list | your list | '/etc/yum. repos. d/rpmfusion * free * repo"

 

 

 

You can also refer:

Http://www.2cto.com/ OS /201110/109175.html

Http://www.2cto.com/ OS /201110/109176.html

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.