In this post, I will explain how to create your own local repository in Centos 7.
sudo su - mkdir /mnt/cdrom #create a mount point mount /dev/cdrom /mnt/cdrom df -h #verify if mounted
ISO comes with inbuilt packages.These packages must have .rpm extension. So, we copy those inbuilt packages to another directory and make it as a new repository.
ls /mnt/cdrom cp -R /mnt/cdrom/Packages /root
Create a configuration file with .repo as extension and add these details into it.
Filename - local.repo
[localrepo] name=Prajwal Repository baseurl=file:///root/Packages gpgcheck=0 enabled=1
In the above file(ie., local.repo),
'name' is the name of the repo,
'baseurl' is the path to the package directory
'gpgcheck' it takes 0 or 1. It's used for security. Only a user with gpgkey can access this repo if it's set to 1
'enabled' it also take 0 or 1. To activate this repo set it to 1.
createrepo is the command to create a repository.
yum info createrepo yum install createrepo createrepo -v /root/Packages
yum repolist all | grep -i prajwal