How to set up Local yum repository in linux

(Last Updated On: September 30, 2018)

How to set up a Local yum repository using locally-mounted DVD

 

 

                            Before we begin about the Local yum repository setup, we need to know about some of the fundamentals about RedHat Package Manager (RPM) and about YUM.

These are very essential if you are planning to stick to Redhat Linux distro and trying to hold ground in IT industry based on Linux System Administration. So in this article, I have tried my best to give an overview of YUM and RPM and make it as simple as possible for you to understand.

So There are some topics that I have elaborated in the main content like what are repositories and how does it work, how does yum repositories work in Linux environments, etc. So let’s just begin.

 

What is Yum?

Ans:    Yum is an initial tool used by RPM-based Linux distributions to install, detect, remove, and manage RPM packages. Yum is also called as Yellowdog Updater Modified. This is used mainly because it examines and evaluates the various files needed for RPM base packages to avoid reliability issues when installing a package. It handles automatic updates of storage.

 

 

What is a repository?

Ans:   A repository is a collection of software for a Linux distribution on a server. You grab information on the software that is available on the server using the packaging tools (in ubuntu it is apt-get || in rhel it is yum) and download the software directly from those.

As I have already mentioned that YUM stands for Yellowdog Updater. It was initially used at Duke University, for managing package installation on their Red Hat based system’s. Yum is also an open source tool for RedHat systems.

YUM Repositories are basically a kind of warehouses of Linux software for RPM package files. YUM Configuration files hold all the information that are required to successfully find and install software packages for Linux distributions (RPM based)

 

What are the main advantages of installing a software from YUM Repository?

So basically, if we consider advantages then there are so many of them that need to be mentioned if you use YUM repository. I have listed below some of those below.

  • Software Management:   Using a local YUM repository you can easily manage software packages(RPM based). You can install a package or remove a package with a very simple process. Ex: –  yum install httpd or yum remove httpd etc.

 

  • Software Dependency:    YUM repository resolved software dependency automatically. Hence you do not need to search for a dependent software anywhere else to install the primary software. It is done automatically.

Except for these basic points, you need to keep it in mind that YUM is the official package manager for RedHat and CentOS. So it is always obvious that I will suggest you t to use an official product.

 

 

So here I am going to create a local repository for your Rhel7 system. So just follow the below steps.

Environment: Red Hat Enterprise Linux 7

Configuration file :  /etc/yum.repos.d/ local.repo

 (The configuration file for yumis generally located under/etc/yum.repos.d/)

 

 

1. Create a directory and Mount the RHEL 7 installation ISO to it.

# mkdir  /rheliso

If you are using a DVD/CD or pen drive then the command will be as follows:

#  mount -o loop   /run/media/rhel7.1.iso   /rheliso

#  cd   /etc/yum.repos.d/

# vim local.repo

 

 [local]

     name = Local Repo 

     baseurl = file:///rheliso

     gpgcheck = 0

     enabled = 1

:wq!   ( save it )

#  yum clean all

#  yum repolist all

# yum info dialog

 

Now you can see something like this. So now this system has been successfully configured the yum local repository. You can now install any software package using this repository.

Install a package

# yum install httpd  -y

Or remove a package

# yum remove httpd -y

Check the status of a package

# rpm -q httpd

You can also configure this as a repository server and access it from the network.

Note*:

If the system is registered to Red Hat Network, Then yum repository will receive the update automatically. You do not need to make any local repository. you just need to fire a simple command and the repository will get all re recent updates automatically all by itself. But the system should have an internet connection for sure.

yum update -y    or     yum upgrade -y

 

So if you have any question regarding this article, feel free to comment below.

 

Conclusion

So, guys, I have tried my best to simplify things so that you can have a better understanding and user experience. Now it’s your turn to pay me back.

Now I am expecting your responses. If you like this content or even dislike,  just leave a comment. Your responses will motivate me to do better and deliver better. I will try my best to enrich my skill.

So thank you guys, Have a good day.

Rate this content
Sending
User Review
4.75 (4 votes)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Ad Blocker Detected

Ad Blocker Detected, please disable it to help this page in many ways. Thank you so much.

Refresh