How to Configure yum Repository in Linux

How to Configure yum Local Repository in Linux







Welcome to everyone today we are going to configure yum local repository in red-hat Linux.

The main purpose it is used  to install the dependency software’s automatically at the time of yum installations.
First off all we need to install red-hat repository supported rpm Packages for yum repository configuration.
Insert red-hat operating system DVD. then go to Rpm Packages directory.

[root]# cd /media/RHEL_6.0\ i386\ Disc\ 1/Packages/

We have to install & verify the required Rpm Packages.

 [root]# rpm -ivh deltarpm-3.5-0.5.20090913git.el6.i686.rpm
 [root]# rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.i686.rpm
 [root]# rpm -ivh createrepo-0.9.8-4.el6.noarch.rpm

Create one local directory for storing the rpm packages.
So you can create as a separate mount point directory.

[root]# mkdir repo

Mount the existing logical volume to newly created directory.

[root]# mount /dev/mapper/datavg-data_lv /repo

Verify if the file system mounted or not.

[root]# df -kh

Go to red-hat DVD Rpm Packages folder.

[root]# cd /media/RHEL_6.0\ i386\ Disc\ 1/Packages/

Copy the entire contend of Packages into newly created mount point /repo

[root]# cp -rvf Packages/ RPM-GPG-KEY-redhat-release /repo

Verify the mount point size and rpm files total counts.

[root]# df -h

Go to /repo directory and list out the file contents.

[root]# cd /repo
[root]# ls -lrt

Create local repository database using createrepo command. it store all local rpm packages informations.

[root]# createrepo --database /repo/Packages/

Edit the repository configure file make some basic changes for local repository setup.

[root@]# vi /etc/yum.repos.d/basic.repo
 name=Local Redhat Repo

Check the yum repolist you can get the information about yum repository.

[root@localhost /]# yum repolist

so you can install the any of the rpm packages with dependency software automatically.
Examples for yum install.

# yum list httpd
# yum list squid
# yum install squid.i686

How to Configure yum Repository in Linux


Related posts

Leave a Comment