How to use yum repository on RHEL without subscription using CentOS' repo
[backup@Bakcup_214 ~]$ sudo vi /etc/yum.repos.d/rhel.repo
[sudo] password for backup:
------------------------------------------------------ VI starts ---------------------------
# Cent.repo
[base]
name=CentOS-6 - Base
baseurl=http://mirror.centos.org/centos/6/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-6 - Updates
baseurl=http://mirror.centos.org/centos/6/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#packages used/produced in the build but not released
[addons]
name=CentOS-6 - Addons
baseurl=http://mirror.centos.org/centos/6/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-6 - Extras
baseurl=http://mirror.centos.org/centos/6/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6 - Plus
baseurl=http://mirror.centos.org/centos/6/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
[backup@Bakcup_214 ~]$ yum repolist
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
addons | 1.9 kB 00:00
addons/primary_db | 1.1 kB 00:00
base | 1.1 kB 00:00
base/primary | 1.3 MB 00:13
base 3667/3667
extras | 2.1 kB 00:00
extras/primary_db | 173 kB 00:01
updates | 1.9 kB 00:00
updates/primary_db | 793 kB 00:06
repo id repo name status
addons CentOS-6 - Addons 0
base CentOS-6 - Base 3,667
extras CentOS-6 - Extras 266
updates CentOS-6 - Updates 777
repolist: 4,710