
In this post, I will explain how to create your own local repository in Centos 7.
1.Attach and mount the iso
sudo su - mkdir /mnt/cdrom #create a mount point mount /dev/cdrom /mnt/cdromdf -h #verify if mounted
2.Copy the Packages from iso
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/cdromcp -R /mnt/cdrom/Packages /root
3.Create .repo file in /etc/yum.repos.d directory
Create a configuration file with .repo as extension and add these details into it.
vi /etc/yum.repos.d/local.repo
Filename - local.repo
[localrepo]name=Prajwal Repositorybaseurl=file:///root/Packagesgpgcheck=0enabled=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.
4.Building local repository
createrepo is the command to create a repository.
yum info createrepoyum install createrepocreaterepo -v /root/Packages
5.Verify if the repository is successfully created.
yum repolist all | grep -i prajwal
Cool then!
Top comments(1)
For further actions, you may consider blocking this person and/orreporting abuse