Can I set up Fedora or Centos repos in RHEL6?

25,037

Solution 1

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

HOWEVER NUMBER 1

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.

HOWEVER NUMBER 2

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

notes

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.

Solution 2

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

Use the link to check out for epel and rpmforge

http://fedoraproject.org/wiki/EPEL

http://dag.wieers.com/rpm/FAQ.php#A1

Solution 3

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.

Share:
25,037

Related videos on Youtube

Liam
Author by

Liam

With over 15 years experience as a Web Developer, I have gained in-depth knowledge of a wide range of web technologies. I have been responsible for the architecture of several key pieces of software for a diverse portfolio of clients, in the Photography, Education, Tourism, and Retail industries. I mostly work with PHP and JavaScript.

Updated on September 18, 2022

Comments

  • Liam
    Liam over 1 year

    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?

    • Liam
      Liam over 12 years
      yes, well an Amazon EC2 virtual machine
    • Sirex
      Sirex over 12 years
      the way i'd do it is with yum-plugin-downloadonly on the subscription machine, and keepcache turned on. then move the rpms over.
    • suprjami
      suprjami almost 11 years
      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.