How to create YUM Repository from ISO or Online

In this tutorial, you will learn how to create yum repository from ISO or online. The Yellowdog Updater Modified (YUM) is an Opensource tool that is used over the command line to manage packages, it is also known as a package management utility for the machine which is running a Linux Operating system using RPM package manager. Like YUM there are several tools used to manage packages in GUI.

It allows you to install, update, and remove software packages on your Linux machine easily. A YUM repository is a collection of RPM packages that can be installed on multiple machines using YUM.

Creating a YUM repository from ISO is a common task in Linux system administration. It allows you to keep a local copy of the RPM packages that are required for your Linux machines, saving time and bandwidth. In this blog post, we will guide you through the steps to create a YUM repository from ISO.

Prerequisites:

To create a YUM repository from ISO, you will need the following:

  • A Linux machine running CentOS, RHEL, or Fedora.
  • An ISO file containing RPM packages.
  • Root access to the Linux machine.

Steps to Create YUM Repository from ISO or Online

You can use ANY Linux – RHEL, CENTOS, MINT or Fedora, etc ISO Image.

Firstly create a directory

The first step is to mount the ISO file containing the RPM packages. To do this, create a mount point directory where you want to mount the ISO file.

$ mkdir /packages

Next, mount the ISO file using the mount command.

$ mount -t iso9660 -o loop /home/user11/Centos-6-x86_x64-DVD.iso /mnt/iso/

Copy the packages from ISO to /packages dir, Once you have copied it then install the required package for creating the yum repo.

Goto /packages dir and follow the below command:

$ rpm –ivh deltarpm
$ rpm –ivh python-deltarpm
$ rpm –ivh createrepo

After installing these packages now we will create a repo file.

Goto /etc/yum.repos.d/ and created one file with the name local-Linux.repo (you can give any name),

$ vi /etc/yum.repos.d/local-linux.repo

[LOCAL REPO]
Name=Local Linux Repo
baseurl=file:///packages
gpgcheck=0
enabled=1

Save this file and now create repo data:

$ createrepo –v /packages

$ yum clean all

Clear the cache and run repo list:

$ yum repolist

When you fire the repo list command you can see your repository also “local-linux.repo”.

Step to create a yum repository by using the online repo

This process is similar to local repo only that you will create repo file with repo URL where all packages are available.

$ rsync –avz rsync://mirror.fibergrid.in/centos/7.2/os/x86_64/Packages/s/ /YUM

Here internet speed must be good, create repo dir

$ createrepo – v /packages

This repo is ready to use.

End of the article, We’ve shown you how to create YUM Repository from ISO or Online.

See also:

List of monitoring tools 

Linux Blogs

AWS Cloud Blogs

Database Blogs

DevOps Blogs

Interview Questions & Answers

Docker Blogs

Google Cloud Blogs