Unable to use yum if RHEL is not registered

Source: Internet
Author: User

I have been switching jobs for nearly two months. I have changed my career this time and will no longer work in the information security field. Therefore, I may not write any questions about information security in my Blog, some O & M and team management experience will be recorded in the future.

Recently, I was migrating a java-based webgame from windows to Linux. This architecture uses nginx for load balancing, distributing requests from different applications to two tomcat servers, 2nd tomcat servers running the game are always inaccessible. It took two days to build the environment and debug the game, the game map cannot be loaded only when the machine configuration is too low (the game map is successfully loaded once the high-end 2U machine is changed ).

I found a 2U slave machine. I logged on to the server and found that gcc was not installed. yum could not be used properly because it was not registered. I recorded the solution for future viewing and encountering the same problems.

1. Delete the default yum of RHEL.

[Root @ localhost ~] # Rpm-qa | grep yum

Yum-updatesd-0.9-2.el5

Yum-metadata-parser-1.1.2-2.el5

Yum-rhn-plugin-0.5.3-30.el5

Yum-3.2.19-18.el5

Yum-security-1.1.16-13.el5

Rpm-e yum * -- nodeps

2. Download and install centos yum

Wget http://mirrors.sohu.com/centos/5.5/ OS /i386/CentOS/yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm

Wgethttp: // response

Wget http://mirrors.sohu.com/centos/5.5/ OS /i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm

[Root @ localhost ~] # Rpm-ivh yum-3.2.22-26.el5.centos.noarch.rpmyum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm

Warning: yum-3.2.22-26.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897

Preparing... ######################################## ### [100%]

1: yum-metadata-parser ################################### ####### [1, 33%]

2: yum-fastestmirror ##################################### ###### [67%]

3: yum

3. Add an image in/etc/yum. repos. d/rhel-debuginfo.repo

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

Add the following content:

[Base]

Name = Red Hat Enterprise Linux $ releasever-Base

Baseurl = http://mirrors.sohu.com/centos/5.5/ OS /?basearch/

Gpgcheck = 1

[Update]

Name = Red Hat Enterprise Linux $ releasever-Updates

Baseurl = http://mirrors.sohu.com/centos/5.5/updates/?basearch/

Gpgcheck = 1

[Extras]

Name = Red Hat Enterprise Linux $ releasever-Extras

Baseurl = http://mirrors.sohu.com/centos/5.5/extras/?basearch/

Gpgcheck = 1

[Addons]

Name = Red Hat Enterprise Linux $ releasever-Addons

Baseurl = http://mirrors.sohu.com/centos/5.5/addons/?basearch/

Gpgcheck = 1

4. Download and import the KEY

"/Etc/yum. repos. d/rhel-debuginfo.repo" 16L, 518C written

[Root @ localhost ~] # Cd/etc/pki/rpm-gpg/

[Root @ localhost rpm-gpg] # wget http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-5

[Root @ localhost rpm-gpg] # rpm -- import/etc/pki/rpm-gpg/RPM-GPG-KEY *

5. You can use yum to install gcc and then compile nginx.

Yum-y install gcc

Yum-y install gcc-c ++

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.