Pages

Tuesday, July 19, 2011

Tip - How to Set Up a Local Yum Repository

Share it Please

Having a local repository is good since we can download packages from the local repository that we specified. We don’t need to go for a DVD or a cd every time when we need to install packages.

Creating a local repository is very simple in rhel. Follow the below steps to configure the local repository. Whenever we try to install any software packages, we use the command

Yum install vsftpd*

RHEL by default looks a file in /etc/yum.repos.d/rhel-debuginfo.repo. The file contains locations where to search for the packages to install. Here is how the file looks











Let’s see how we can configure this.
1. Copy the entire RHEL DVD contents to /var/ftp/pub location.
2. Once all are copied. Search for createrepo.rpm package in /var/ftp/pub/Server/.
3. Once the file is available, right click the file and select install using software installer. It will install the package into the system.
4. Once the package is installed, now it’s time to modify the above rhel-debuginfo.repo file.
5. Change the baseurl as shown in the above figure. We are saying that whenever we need to install any package first check the package at the URL specified for the baseusrl(in this case search in the /var/ftp/pub).
6. Once the file is modified .Save the file.
7. Go to the /var/ftp/pub location and execute the command

             createrepo –p .

It will take a few minutes to create a repository.
                         
The next step would be to clean the repository data. Execute yum clean all






Once cleaning is done, we need to update execute yum update.
 

 




Try executing yum install vsftpd*. The package will install now.

More tips to come. Happy Coding…
 

No comments :

Post a Comment