Setting up a Local YUM Repository
Setting up the YUM Server
Setting up a local YUM repository provides many benefits in situations like where hosts in a network does not have access to Internet . Also , installing a package from a local YUM repository is faster because of low latency as compared to Internet . The YUM repository can have access to Internet so that the repository is always updated with latest software updates . Please find below steps to setup a local YUM repository.
1. Create a directory to be used for setting up a repository
# mkdir /var/www/html/rhelimages
2. Dump contents of RHEL DVD to the above created directory
# cp -r /media/cdrom/* /var/www/html/rhelimages/
3. Install the createrepo package if not already installed
# yum install createrepo
4. Now , setup the repository . We can use the -g option to enable group listing with yum command.
5. Install httpd package if not already installed and start the service
# yum install httpd
Configuring client machines to access Local YUM Repository1. Open any yum repo file under /etc/yum.repos.d/ directory and add the following entry as shown below
$ cat /etc/yum.repos.d/redhat.repo
name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source
#e.g baseurl= < YUM Repository IP Address>/rhelimages
$ yum install vim
If the above commands are working fine , then we did a successfull setup of YUM repository. Start installing your packages now.