Search This Blog

Saturday, January 16, 2016

How to configure YUM Server in Linux(RHEL 6)

YUM stand for Yellowdog Updater Modified which is developed to maintain an RPM-based system. By default YUM server use online repository but it can be configured for local repository. In this tutorial we will configure yum server in RHEL 6.2 with local repository. The process of configuring yum server in RHEL 6.0 is same as RHEL 6.2. Main xml file name is different in this two version. Another different named file is server.repo in 6.0 and rhel-source.repo in 6.2.
The step what is done during configuring yum server is as bellow :
  • step 1: I've created a directory named yum_repo.
  • step 2: Directly copy Packages folder to yum_repo directory from linux dvd.
  • step 3: Directly copy main xml file (8afad1febf2d8844a235a9ab1aa5f15c9cec1219b9d01060d4794435cf59dffe-comps-rhel6-Server.xml) to yum_repo directory from linux dvd. Then rename the file as comps-rhel6-Server.xml for ease of use. you can rename it as you like.
  • step 4: Install Three RPM which are required for YUM Server- deltarpm, python-deltarpm and createrepo. To do so, change your working directory to Packages
    then enter the following command
    now you can Verify that the RPM is installed successfully by following command
  • step 5: Generate local repository files using main xml file (yum_repo/comps-rhel6-Server.xml) command is as bellow createrepo -g /yum_repo/comps-rhel6-Server.xml . N.B. After file path(/yum_repo/comps-rhel6-Server.xml) a space and a dot is required. this dot tel Linux to create repository to current directory(yum_repo/Packages)
  • step 6: Now it is needed to create new entry in rhel-source.repo(server.repo in 6.0) file. File location is /etc/yum.repos.d/rhel-source.repo to Create new entry in rhel-source.repo file open the file with vi editor. Command for opening the file vi /etc/yum.repos.d/rhel-source.repo after opening the file press i from your keyboard to go to insert mode. Now make the entry as bellow images.
    Press esc button to exit insert mode. press :wq to save and exit vi editor.
  • step 7: During this configuration process yum creates a cache of metadata and packages. This cache can take up a lot of space. yum clean all command allows you to clean up these files.
  • step 8: To download and make usable all the metadata for the currently enabled yum repository use the following command yum makecache
  • step 9: To list all packages and package group from all the repositories configured use the command yum list all and yum grouplist.
  • step 10: Test Yum server by installing any RMP from newly configured yum server. you can install binutils [This RPM is required for Oracle server] open a new terminal and enter the following command
  • DONE!! Enjoy YUM Server!!
If you have any query, please let me know through comment. -Thank You.

No comments:

Post a Comment

Thank you for your valuable comments!