How to configure a CentOS yum source for Redhat

Source: Internet
Author: User
Because the redhat yum online update is charged, it cannot be used if it is not registered. to use it, you need to uninstall the redhat yum, restart the installation, and configure other sources, the detailed process is as follows: 1. delete the original yumrpm-aq | grepyum | xargsrpm-e -- nodeps2. download the yum installation file wgethttp: // mirrors.16

BecauseRedhatYum online update is charged. it cannot be used if it is not registered. if you want to use it, uninstall the yum of redhat and restart it.InstallAnd configure other sources. the detailed process is as follows:


1. delete the original yum of redhat. 
Rpm-aq | grep yum | xargs rpm-e -- nodeps

2. Download The yum installation file
Wgethttp: // mirrors.163.com/Centos/6/OS/x86_64/Packages/yum-3.2.27-14.el6.Centos. Noarch. rpm
Wgethttp: // response
Wgethttp: // response
Wgethttp: // response

3. install yum

Rpm-ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
Rpm-ivh yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm
Rpm-ivh yum-3.2.27-14.el6.centos.noarch.rpmum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm
Note that the last two packages must be installed at the same time, otherwise they will depend on each other.

4. update the repo file

Mv/etc/yum. repos. d/rhel-debuginfo.repo/etc/yum. repos. d/rhel-debuginfo.repo.repo.bak

Vi/etc/yum. repos. d/rhel-debuginfo.repo

Content:

[Base]
Name = CentOS-$ releasever-Base
Baseurl = http://mirrors.163.com/centos/6.0/ OS /?basearch/
Gpgcheck = 1
Gpgkey = http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6

# Released updates
[Updates]
Name = CentOS-$ releasever-Updates
Baseurl = http://mirrors.163.com/centos/6.0/updates/?basearch/
Gpgcheck = 1
Gpgkey = http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6

# Packages used/produced in the build but not released
# [Addons]
# Name = CentOS-$ releasever-Addons
# Baseurl = http://mirrors.163.com/centos/?releasever/addons/?basearch/
# Gpgcheck = 1
# Gpgkey = http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
# Additional packages that may be useful
[Extras]
Name = CentOS-$ releasever-Extras
Baseurl = http://mirrors.163.com/centos/6.0/extras/?basearch/
Gpgcheck = 1
Gpgkey = http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
# Additional packages that extend functionality of existingpackages
[Centosplus]
Name = CentOS-$ releasever-Plus
Baseurl = http://mirrors.163.com/centos/6.0/centosplus/?basearch/
Gpgcheck = 1
Enabled = 0

5. yum clean all

6. yum install vim # Can I test it?

[Set the local image as the yum source]

1. mkdir/mnt/cdrom

2 mount/dev/cdrom/mnt/cdrom # Images and CDs are hung

3 mkdir/home/redhat-iso

4 cp-Rf/mnt/cdrom/*/home/redhat-iso # copy the content in the CD to a specific path

5 vi/etc/yum. repos. d/rhel-debuginfo.repo # Edit repo file

Add the following content:

[Rhel_6_iso]
Name = local iso
Baseurl = file: // home/redhat-iso/
Gpgcheck = 1
Gpgkey = file: // home/redhat-iso/RPM-GPG-KEY-CentOS-6 # The gpgkey file here should be changed to the file name in the iso image

Note:

When installing the program with yum in RHA5, the following exception occurs:
Is this OK [y/N]: y
Downloading Packages:
Warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897

RHA5

Solution:

Rpm -- importhttp: // centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5


For earlier versions, you can use

Rpm -- importhttp: // centos.ustc.edu.cn/centos/RPM-GPG-KEY-centos4


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.