How to configure local yum repository in centos 6

We can configure yum local repository either by using centos6 install dvd or we can build a yum repository from rpm packages that we have in a directory.

1. Creating local yum repositoy from centos6 install media

When you will insert dvd in desktop mode it will automatically get mounted itself but we need to mount this on custom location hence umount it

# umount /dev/sr0
# mount /dev/sr0 /media

Now create a .repo file inside /etc/yum.repose.d directory

# vim /etc/yum.repose.d/local.repo

write bellow lines

[localrepo]
name=my local yum repo
baseurl=file:///media
enabled=1
gpgcheck=0
save and exit now run repolist to verify packages avilable

# yum repolist

2. Creating local yum repo with custom rpm packages

First install createrepo package
# yum install createrepo -y
( you can configure a local yum repository as per above method for installing this package)

assume i have some rpms files inside directory /root/389ds

#createrepo /root/389ds

create a .repofile
#vim /etc/yum.repose.d/localyum.repo
insert lines as given bellow

[localrepo]
name=my local yum repo
baseurl=file:///root/389ds
enabled=1
gpgcheck=0

save and close file verify packages by yum repolist command.

Comments

Popular posts from this blog

Running web ssh client on port 443 /80 with nginx as reverse proxy

Running cockpit behind nginx reverse proxy with nginx ssl and cockpit non ssl

Setup VOD streaming server with nginx using RTMP on Ubuntu 18.04