Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Your own local repository.
vanquisher
vanquisher

Posted on

     

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/cdromdf  -h            #verify if mounted
Enter fullscreen modeExit 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/cdromcp -R  /mnt/cdrom/Packages    /root
Enter fullscreen modeExit 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 modeExit fullscreen mode

Filename - local.repo

[localrepo]name=Prajwal Repositorybaseurl=file:///root/Packagesgpgcheck=0enabled=1
Enter fullscreen modeExit 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 createrepoyum install createrepocreaterepo -v  /root/Packages
Enter fullscreen modeExit fullscreen mode

5.Verify if the repository is successfully created.

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

Cool then!

Top comments(1)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
lbonanomi profile image
lbonanomi
Internet loudmouth since 1996
  • Location
    The Hot Aisle
  • Joined

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

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Active learner.
  • Location
    Mysore
  • Education
    The National Institute Of Engineering
  • Work
    Site Reliability Engineer at Cohesity
  • Joined

More fromvanquisher

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp