I have a RHEL6 box with no subscription to Red Hat Network. I want to install gcc using yum to resolve all the complex dependencies. Can I connect to Fedora or Centos repositories to install software? If so, how?

  • do you have any machine with a redhat subscription ? – Sirex Jan 30 '12 at 15:09
  • yes, well an Amazon EC2 virtual machine – Liam Jan 30 '12 at 15:11
  • the way i'd do it is with yum-plugin-downloadonly on the subscription machine, and keepcache turned on. then move the rpms over. – Sirex Jan 30 '12 at 15:36
  • Be aware of two things. Firstly, it is a breach of the Red Hat license to have a RHEL system installed without a RHEL entitlement. Secondly, if you have CentOS packages installed, your system will likely not be supported by Red Hat, you may need to reinstall the OS to get tech support from them. – suprjami Jul 12 '13 at 12:22

Short Answer

Install the equivalent centos-release package from a centos downloads location; This will enable the CentOS package repos where you can do a yum update or a yum install gcc

Long(er) Answer

With respect to the other answers, I felt a slight more full answer could be given to your question.

CentOS aims to be 100% binary compatible with RHEL, hence CentOS 6.2 packages should install and run on RHEL 6.2;

"CentOS conforms fully with the upstream vendors redistribution policies and aims to be 100% binary compatible. (CentOS mainly changes packages to remove upstream vendor branding and artwork.)." http://wiki.centos.org/FAQ/General#head-d29a2b7e61ffc544973098f9dd49fe4663efba50

So you can download the "centos-release" package from a CentOs mirror for the release of RHEL you have chosen; CentOS Mirrors List, and that will install the CentOS-Base repo files to enable the CentOs repositories to work in RHEL.

This migration guide covers some of the processes of migrating from RHEL to CentOS in-place - http://wiki.centos.org/HowTos/MigrationGuide


A fresh installation of CentOS is always recommended. There will be some problems, and some package cleaning up required if you mix repositories. This is mainly because its a hack to do this, and its not widely tested.


CentOS patch levels do not follow the same naming convention as RHEL patches, due to Redhat restrictions and other naming issues.

So there will be a bunch of problems that occur when 3rd party apps rely on redhat-release or centos-release, or some RHEL derived naming for packages and updates, see here for an example of the RHEL vs CentOS naming problems; http://lists.centos.org/pipermail/centos/2011-April/110995.html


Fedora is based off different source code branches, and hence different shared libraries and kernel revisions. It's unlikely that any of the compiled packages would work across these distros.

EPEL and rpmforge are typically for software packages rather than base-system packages, hence are unlikely to be of any use for your purposes of resolving dependencies for basic stuff.

| improve this answer | |

Fedora is not compatible with RHEL in general. Especially as something basic as gcc I would not recommend using Fedora RPMs.

If you can't get hold of RHEL rpms you can try CENTOS rpms from one of its mirrors since CENTOS prides itself in being binary compatible with RHEL.

| improve this answer | |

You can try with the repo file of epel and rpmforege.

Use the link to check out for epel and rpmforge



| improve this answer | |

Ran into the same problem. There are some help here that did use CentOS repository: http://www.if-not-true-then-false.com/2010/install-mysql-on-fedora-centos-red-hat-rhel/

Read only Step 2 (Install Remi repository for CentOS and RedHat).

Hope this helps.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.