Learning Horizon | For Learners

ASP.NET, SQL SERVER, JQUERY,JAVASCRIPT, WEBSPHERE

Thursday, 18 April 2019

How To Mount Linux ISO File | Setup Yum Repository

Today in this tutorial we will learn about how to mount the Redhat Linux .ISO file to a directory and setup a Yum repository so that we can install Apache and other software packages from repository. I’ve setup a local VM for this purpose and below are the steps that you can follow to reach home safely.
  1. First copy your redhat .ISO media file to your Linux desktop or home directory. Since I am using Xshell so I use built-in Xftp to copy .ISO file on my home directory of VM.

  2. Mount this .ISO installation media file to some folder/directory using below command. In my case I’ve mounted it to /mnt directory.
    mount -o loop /home/rhel-server-7.6-x86_64-dvd.iso /mnt
    or
    mount /home/rhel-server-7.6-x86_64-dvd.iso /mnt

  3. Copy media.repo file from/mnt directory to /etc/ and then yum.repos.d/ directory using below command. In my case I’ve renamed this file to rhel7.repo while copying it. You can choose whatever name just make sure that its extension would be (.repo).
    cp /mnt/media.repo /etc/yum.repos.d/rhel7.repo

  4. Give permissions to this rhel7.repo file using below command.
    chmod 644 /etc/yum.repos.d/rhel7.repo
  5. Now modify this repo file. Add mentioned below lines at the end of this file.
    enabled=1
    baseurl=file:///mnt/
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
  6. Also change gpgcheck parameter value from 0 to 1 and save it using :wq! command. Your file will look like this

  7. Clean the cache using below command.
    yum clean all
  8. To verify use below command
    yum repolist

No comments:

Post a Comment

Please do not enter spam links.