Showing posts with label yum repo from local ISO. Show all posts
Showing posts with label yum repo from local ISO. Show all posts

Wednesday, April 1, 2015

How to create yum local repository in RHEL7/CentOS7 using ISO image



If you have a fresh installation of red hat enterprise linux 7, you cannot access yum commands by default. Also you have to subscribe redhat to get repository updates from the internet.
I explained below how to make local yum repository and map using iso image in the cdrom.
First mount cdrom to a specific folder,

[akila@localhost ~]# mount /dev/cdrom  /<yourDirectory>

Then create and start editing new repo using below command, RHEL_7_Disc.repo is your local .repo file
[akila@localhost ~]# vi /etc/yum.repos.d/RHEL_7_Disc.repo

Then add below command in the file,

[RHEL_7_Disc]
name=RHEL_7_x86_64_Disc
baseurl="file:///<DirectoryYou mount your cdrom>/"
gpgcheck=0

That’s all. You have successfully created local yum repository in your machine.
Check repolist using below command, and you will see below result,

[root@lolfusionlbone ~]# yum repolist
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
repo id                          repo name                                status
RHEL_7_Disc                      RHEL_7_x86_64_Disc                       4,305
repolist: 4,305

Just try to install telnet using yum command to test the installation of repository by using below command,

[root@lolfusionlbone ~]# yum install telnet