When installing the software on Red Hat today, we found that we needed to rely on software, but when using the sudo yum command, the following error occurred:
This system isn't registered to Red Hat Subscription Management. You can use the Subscription-manager to register.
This problem occurs because Redhat is not registered, and when it connects to the Redhat official software source, it does not provide permission to download the package for unregistered users.
Workaround: Because CentOS and Redhat are "born from the same root", the CentOS software source can be used.
1. Detection of the system "Important】
This step often does not attract the attention of users. However, ignoring this step will waste time on the next steps. Please remember: Ax.
① View System version number : Cat/etc/redhat-release
Result: Red Hat Enterprise Linux Server release 6.5 (Santiago)
② View the number of system bits : Arch
The result is: x86_64
③ Check if the Yum package is installed : Rpm-qa |grep Yum
Note: The pipe command is used.
2. Delete your own Yum pack
① do not check dependencies, directly delete rpm package : Rpm-qa|grep Yum|xargs rpm-e--nodeps
② Query Confirmation : Rpm-qa |grep Yum
If the query result is empty, then the delete yum succeeds.
3. Install the new Yum
① Download Yum Pack
This step is based on the first step.
If the Redhat version is 6.+ and the number of system bits is x86_64, the following download command is performed:
wget Http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpmwget/HTTP Mirrors.163.com/centos/6/os/x86_64/packages/yum-3.2.29-73.el6.centos.noarch.rpmwget http://mirrors.163.com/ centos/6/os/x86_64/packages/yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
If the Redhat version is 6.+ and the number of system bits is i386, the following download command is performed:
# wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm# wget/http mirrors.163.com/centos/6/os/i386/packages/yum-3.2.29-73.el6.centos.noarch.rpm# wget http://mirrors.163.com/ centos/6/os/i386/packages/yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
Note: Since the CentOS software source has been updated, if the above download command cannot find the file, then go to Http://mirrors.163.com/centos to view the corresponding file. In short, the final download to complete the 3 files on it. Other versions of the Yum package are downloaded and so on.
② Installing the Yum pack
RPM-IVH yum-*
Errors are most likely to occur at this step.
A. If the error is:
Error:failed dependencies:libc.so.6 is needed by yum-metadata-parser-1.1.2-16.el6.i686libc.so.6 (GLIBC_2.0) is needed by Yum-metadata-parser-1.1.2-16.el6.i686libc.so.6 (glibc_2.1.3) was needed by Yum-metadata-parser-1.1.2-16.el6.i686libglib-2.0.so.0 is needed by Yum-metadata-parser-1.1.2-16.el6.i686libpthread.so.0 is needed by yum-metadata-parser-1.1.2-16.el6.i686libpython2.6.so.1.0 is needed by Yum-metadata-parser-1.1.2-16.el6.i686libsqlite3.so.0 is needed by Yum-metadata-parser-1.1.2-16.el6.i686libxml2.so.2 is needed by yum-metadata-parser-1.1.2-16.el6.i686libxml2.so.2 ( libxml2_2.4.30) is needed by Yum-metadata-parser-1.1.2-16.el6.i686python-urlgrabber >= 3.9.1-10 are needed by Yum-3.2.29-73.el6.centos.noarch
Indicates that the package is incompatible. For example, I am a 64-bit system that downloads 32 of the packages.
B. If the error is:
Warning:yum-metadata-parser-1.1.2-16.el6.x86_64.rpm:header V3 rsa/sha1 Signature, key ID c105b9de:nokey error: Failed dependencies: python-urlgrabber >= 3.9.1-10 is needed by Yum-3.2.29-73.el6.centos.noarch
Is the problem that the dependency condition is not satisfied.
You can do this by following these steps:
Step one: Rpm-qa|grep python
Python-urlgrabber-3.9.1-9.el6.noarch in the Discovery list, less than 3.9.1-10
Step two: Uninstall Python-urlgrabber-3.9.1-9.el6.noarch:rpm-e Python-urlgrabber-3.9.1-9.el6.noarch
Step three: Download: wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm
Step four: Installation: Rpm-ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm
4. Change the Yum source
① Download Yum configuration file
Cd/etc/yum.repos.dwget Http://mirrors.163.com/.help/CentOS6-Base-163.repo
② Configuration
sudo vim Centos6-base-163.repo
Replace the $releasever with the version number of the existing system (6)
Use the VIM replacement command in command mode (more vim >>>)
:%s/$releasever/6/g
Exit Save
5. Rebuilding the cache
Clean all #清除原有缓存yum makecache #重建缓存 to improve the speed of search and installation software
6. Testing
Yum seach git
7. Updating the system
Yum Update
Note: This step may take a long time, if not willing to wait, can not proceed first.
8. Reference URL
http://blog.csdn.net/xy2204/article/details/51781287
http://qingwang.blog.51cto.com/505009/1551228/
http://blog.163.com/chenchen..1986/blog/static/76063146201645243952/
RedHat6.5 Updating the software source