Centos/redhat installation Yum Source

Source: Internet
Author: User
Tags gpg

a few words of nonsense:
Red Hat's Yum online update is charged, unregistered is not used, this is to fill the serial number activated, the solution is to replace the CentOS yum.

Query the original Yum
[Root@orcl ~]# Rpm-qa |grep Yum
Yum-plugin-fastestmirror-1.1.30-37.el6.noarch
yum-metadata-parser-1.1.2-16.el6.i686
Yum-utils-1.1.30-37.el6.noarch
Yum-plugin-security-1.1.30-37.el6.noarch
Yum-3.2.29-75.el6.centos.noarch
Yum-rhn-plugin-0.9.1-43.el6.noarch

Delete the original Yum
[Root@orcl ~]# rpm-aq|grep Yum|xargs rpm-e–nodeps
[Root@orcl ~]# Rpm-qa |grep Yum
[Root@orcl ~]#

querying the original yum configuration
[Root@orcl ~]# Whereis Yum
Yum:/etc/yum
[Root@orcl ~]# Rm-fr/etc/yum

Download the required installation package
http://mirrors.163.com/centos/6.8/os/i386/Packages/
The system is 32, so I choose I386. 64 to find x86_64. can be downloaded using wget http://mirrors.163.com/centos/6.8/os/i386/Packages/yum-3.2.29-73.el6.centos.noarch.rpm
yum-3.2.29-73.el6.centos.noarch.rpm
yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
yum-metadata-parser-1.1.2-16.el6.i686.rpm
python-iniparse-0.3.1-2.1.el6.noarch.rpm

Install Python
[Root@orcl ~]# rpm-ivh python-iniparse-.... noarch.rpm
Warning:python-iniparse-0.4-9.el7.noarch.rpm:header V3 rsa/sha256 Signature, key ID F4a80eb5:nokey
error:failed dependencies:
Python (ABI) = 2.7 is needed by python-iniparse-0.4-9.el7.noarch
The current installation version is incompatible with the server, back up a version and try again. View the current release version number Cat/etc/issue

Error: system bits are inconsistent with the number of installer packages File/bin/ls
error:failed dependencies:
libc.so.6 () (64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64
Libc.so.6 (glibc_2.2.5) (64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64
libglib-2.0.so.0 () (64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64
libpthread.so.0 () (64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64
libpython2.6.so.1.0 () (64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64
libsqlite3.so.0 () (64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64
Libxml2.so.2 () (64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86 _64
Libxml2.so.2 (libxml2_2.4.30) (64bit) is needed by yum-metadata-parser-1.1.2-16.el6.x86_64

re-download 32-bit package
[root@orcl ~]# RPM-IVH python-iniparse-0.3.1-2.1.el6.noarch.rpm
Preparing ... # # ######################################### [100%]
Package Python-iniparse-0.3.1-2.1.el6.noarch is already Installed
[root@orcl ~]# RPM-IVH yum-metadata-parser-1.1.2-16.el6.i686.rpm
Preparing ... ###################### ##################### [100%]
1:yum-metadata-parser ########################################### [100%]
[ ROOT@ORCL ~]# RPM-IVH yum-3.2.29-73.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
Preparing ... ########################################### [100%]
1:yum-plugin-fastestmirro###################### ##################### [50%]
2:yum ########################################### [100%]
[ROOT@ORCL ~]#
Note that the last two packages must be installed at the same time, or they will depend on each other

Change the Yum source (using NetEase's CentOS mirror source)
[root@localhost yum]# cd/etc/yum.repos.d/
[root@localhost yum.repos.d]# RM-RF *
[root@localhost yum.repos.d]# wget Http://mirrors.163.com/.help/CentOS6-Base-163.repo
[ Root@localhost yum.repos.d]# VI centos6-base-163.repo
Change all $releasever to a specific version number, I write here is 6.8, this oneself opens (http:// Mirrors.163.com/centos) You can find it.

# Centos-base.repo # The Mirror system uses the connecting IP address of the client and the ' # Update status of each MIRR  or to pick mirrors which are updated to and # geographically close to the client.
You are should use this for CentOS updates # unless to are manually other picking.
# # If The mirrorlist= does not work for your, as a fall back you can try the # remarked out Baseurl= line instead. # [Base] name=centos-$releasever-base-163.com baseurl=http://mirrors.163.com/centos/6.8/os/$basearch/#mirrorlist =http://mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo=os gpgcheck=1 gpgkey=http:// mirror.centos.org/centos/rpm-gpg-key-centos-6 #released Updates [updates] name=centos-$releasever-updates-163.com b aseurl=http://mirrors.163.com/centos/6.8/updates/$basearch/#mirrorlist =http://mirrorlist.centos.org/?release=$ Releasever&arch= $basearch &repo=updates gpgcheck=1 gpgkey=http://mirror.centos.org/centos/ Rpm-gpg-key-centos-6 #additional PACkages so may useful [extras] name=centos-$releasever-extras-163.com baseurl=http://mirrors.163.com/centos/6.8/e xtras/$basearch/#mirrorlist =http://mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo= Extras gpgcheck=1 gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-6 #additional packages that extend functionality of existing packages [Centosplus] name=centos-$releasever-plus-163.com baseurl=http://mirrors.163.com/ centos/6.8/centosplus/$basearch/#mirrorlist =http://mirrorlist.centos.org/?release= $releasever &arch=$ Basearch&repo=centosplus gpgcheck=1 enabled=0 gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-6 # Contrib-packages by Centos Users [contrib] name=centos-$releasever-contrib-163.com baseurl=http://mirrors.163.com/ce ntos/6.8/contrib/$basearch/#mirrorlist =http://mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo=contrib gpgcheck=1 enabled=0 Gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-cenTOS-6 

clean up the yum cache
Yum Clean All

display an installed package and an accessible package
Yum List

You can update packages or install as required
Yum Update/yum Install package name

It's over, guys.

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.