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

1 comment:

  1. Hi, guys!
    Here is really good explanation how to accomplish the task
    http://dbpilot.net/2018/02/06/creating-a-local-yum-repository-using-an-iso-image/
    http://dbpilot.net/2018/02/06/creating-a-local-yum-repository/
    http://dbpilot.net/2018/02/05/caching-all-packages-after-yum-has-installed-it/
    http://dbpilot.net/2018/02/05/downloading-a-package-without-installing-it/

    ReplyDelete