DEV Community

Cover image for Your own local repository.
vanquisher
vanquisher

Posted on

3 3

Your own local repository.

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/cdrom
df  -h            #verify if mounted 
Enter fullscreen mode Exit fullscreen mode

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/cdrom
cp -R  /mnt/cdrom/Packages    /root
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Filename - local.repo

[localrepo]
name=Prajwal Repository
baseurl=file:///root/Packages
gpgcheck=0
enabled=1
Enter fullscreen mode Exit fullscreen mode

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 createrepo
yum install createrepo
createrepo -v  /root/Packages 
Enter fullscreen mode Exit fullscreen mode

5.Verify if the repository is successfully created.

yum repolist all | grep -i prajwal  
Enter fullscreen mode Exit fullscreen mode

Cool then!

Image of AssemblyAI

Automatic Speech Recognition with AssemblyAI

Experience near-human accuracy, low-latency performance, and advanced Speech AI capabilities with AssemblyAI's Speech-to-Text API. Sign up today and get $50 in API credit. No credit card required.

Try the API

Top comments (1)

Collapse
 
lbonanomi profile image
lbonanomi

I like the ISO install instructions! This is super handy for air-gapped environments!

Image of Bright Data

High-Quality Data for AI – Access diverse datasets ready for your ML models.

Browse our extensive library of pre-collected datasets tailored for various AI and ML projects.

Explore Datasets

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay