RedHat 7 – Setup locally mounted CD/DVD/ISO as yum repository

1. Mount the disk to /media folder
2. copy media.repo from the root of the disk to /etc/yum.repos.d/ and set permission to 644
3. edit the media.repo changing gpgchedk from 0 to 1 and adding the following lines:

enabled=1
baseurl=file:///media/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

4. Clear caches:
yum clean all
subscription-manager clean

5. list and update yum

yum list
yum update

LINUX – Using Local YUM REPO on RedHat 7 using DVD ISO

Often I need to install packages that are on the RHEL install DVD and being able to use the install ISO without having a Red Hat subscription or license is extremely useful.

  • Mount the DVD to cdrom folder
mkdir /cdrom
 mount /dev/cdrom /cdrom
  • Create yum local repo file:
cd /etc/yum.repos.d
 vi local.repo

and past this content:

[LocalRepo]
 name=Local Repository
 baseurl=file:///cdrom
 enabled=1
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

save the file and clean yum repository cache:

yum clean all

Job done.

RHEL/CentOS – How to enable EPEL Repository

What is EPEL?

EPEL (Extra Packages for Enterprise Linux) is a volunteer-based community effort from the Fedora project to create a repository of high-quality add-on packages that complement the Fedora-based Red Hat Enterprise Linux (RHEL) and its compatible spinoffs, such as CentOS and Scientific Linux.

Why?

  1. it provides tons of open source packages that can be installed via YUM
  2. maintained by Fedora – therefore trusted

How?

## RHEL/CentOS 7 64-Bit ##
# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
# rpm -Uvh epel-release-7-5.noarch.rpm
## RHEL/CentOS 6 32-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -Uvh epel-release-6-8.noarch.rpm

## RHEL/CentOS 6 64-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -Uvh epel-release-6-8.noarch.rpm
## RHEL/CentOS 5 32-Bit ##
# wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# rpm -Uvh epel-release-5-4.noarch.rpm

# wget http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
# rpm -Uvh epel-release-5-4.noarch.rpm
## RHEL/CentOS 4 32-Bit ##
# wget http://download.fedoraproject.org/pub/epel/4/i386/epel-release-4-10.noarch.rpm
# rpm -Uvh epel-release-4-10.noarch.rpm

## RHEL/CentOS 4 64-Bit ##
# wget http://download.fedoraproject.org/pub/epel/4/x86_64/epel-release-4-10.noarch.rpm
# rpm -Uvh epel-release-4-10.noarch.rpm

once the package is installed update yum and verify that epel is in on our repo list:

[root]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.strencom.net
 * epel: epel.check-update.co.uk
 * extras: mirror.strencom.net
 * updates: mirror.strencom.net
No packages marked for update
[root]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.strencom.net
 * epel: epel.check-update.co.uk
 * extras: mirror.strencom.net
 * updates: mirror.strencom.net
repo id                                 repo name              status
base/7/x86_64                           CentOS-7 - Base        9,007
epel/x86_64                             Extra Packages for Enterprise Linux 7 - x86_64        9,111
extras/7/x86_64                         CentOS-7 - Extras        191
updates/7/x86_64                        CentOS-7 - Updates       369
repolist: 18,678