Today we will show you how to create repository in Linux. We know that we can install packages in Linux by using RPM (Red Hat Package Management) but disadvantage is that by using RPM we can’t install packages wich depend on other packages i.e dependencies. so in order to install packages which depend on other packages, we have to install packages by using YUM (Yellowdog Updater Modified). Actually YUM is added from RHEL5 onwards. YUM uses a repository for installation. YUM automatically computes dependencies and figure out what things should occur to install packages. YUM can install, remove upgrade or query the packages.
How to Create Repository?
Follow these tips to add a local repository in your hard drive, here I am showing how to create repository in RHEL6.
Step 1: Create any folder i.e Directory
[code]# mkdir /var/ftp/pub[/code]
Step 2: Move all RHEL DVD files to this directory /var/ftp/pub
[code]# cd /var/ftp/pub[/code]
Step 3: Append the file localRepo:
[code]# cd /etc/yum.repos.d[/code]
[code]# vi localRepo.repo[/code]
:wq! (Save and Quit)
Step 4: Create repository
[code]#rpm -ivh createrepo* –force[/code]
[code]#createrepo -g /var/ftp/pub/repodata/repomd.xml /var/ftp/pub/Packages[/code]
Step 5: Run following command
[code]# yum clean all[/code]
To checkout list of installed packages use following command:
[code]# yum list installed[/code]
So this is all about how to create repository. Actually we make our system to know where repository is located i.e index.
Following video is not created by me, this video is created by Tim Tan, so the procedure is bit difference, you can follow any procedure :)