Thursday, September 3, 2015

How to configure YUM Server in RHEL6

In this tutorial we will configure yum server in RHEL6 with local repository. YUM is a software package manager used for RPM management. YUM make it easier to install, update and remove RPM.
  • YUM stand for Yellowdog updater modified
  • YUM is based on YUP which stand for Yellowdog Updater
  • YUM is developed to maintain an RPM-based system
  • By default YUM server use online repository
  • YUM can be configure to look for a RPM in multiple location
  • Repository may contain multiple versions of the same RPM package
  • Repository may contain different builds for different architectures for example one for i686 and other for x86_64
  • Internet access is not available during the RHCE 6 exam
  • YUM server allow you to create local repository
  • During the exam you could have a connection to local repository
  • Use YUM to install and remove RPM wherever possible during the exam
  • YUM automatically resolve software dependencies
  • YUM can automatically search for appropriate version of RPM
  • YUM can automatically detect appropriate architectures
  • Above three features of YUM can save a lot of time during the exam
In this tutorial I will use two systems Server and linuxclient from our LAB environment. I will configure YUM Server on Server system and yum client on linuxclient system. If you want to check the network topology used in this article please check following article. Lab set up for RHCE 6 practice.

Configure YUM Server in RHEL 6

During this process we will copy the entire DVD of RHEL 6, so make sure that you have sufficient space on root directory
df-h
Insert RHEL 6 DVD and mount it in media folder
ls-media-rhel6-disk
RHCE 6 exam cover Anonymous only download for FTP server so in this tutorial we will store repository on a local FTP server, you can choose any other directory like /opt as per your need.
For this article I assume that you have configured FTP server. You can check our previous article for FTP server.
Check vsftpd RPM and service. (Skip if you want to use other directory)
vsftpd
Make directories yum/rhel6/repodata in the folder which you have chosen for repository.
For FTP server it would be /var/ftp/pub folder
mkdir
Copy all RPM from RHEL 6 DVD located in Packages folder to /var/ftp/pub/yum/rhel6/repodata
cp-arf
Copy main xml file to our repodata folder. (Required for group installation)
cp-comps
Three RPM are required for YUM Server.
  • deltarpm
  • python-deltarpm
  • createrepo
missing-rpm
We have copied All RPM from DVD to repodata directory. Now we can install RPM directly from repodata folder.Change directory torepodata
cd-repodata
Install any missing RPM.
install-missing-rpm
Verify that we have all necessary RPM
verify-rpm
Change directory to /var/ftp/pub/yum/rhel6
cd-rhel6
Generate local repository files from repodata folder [ repodata folder :- which contain all RPM copied from RHEL6 DVD] to current folder [rhel6]
createrepo-completed
Create new server.repo file
vi-server-repo
To point local repository set following values and save the file
server-repo-file
During its normal use 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.
yum-clean-all
yum makecache is used to download and make usable all the metadata for the currently enabled yum repository.
makecache
yum list all will list all packages from all the repositories configured. With this it will also list all the packages installed on your system
yum-list-all
yum grouplist will list all package groups from all the repositories configured
grouplist
Test Yum server by installing squid [RPM required for squid proxy server]
yum-install-squid
We have successfully configured YUM server with local repository. But client system will not be able to access this repository yet. We need to configure FTP server for anonymous download. We have already configured FTP server in our previous article so in this article we are going to include only those steps which required for YUM setup. Check our previous article for detailed explanations of FTP server.
Open main configuration file of FTP server
vi-etc-vsftpd
Uncomment anonymous_enable directives and save the file
anonymous-enable
Configure iptable rule to allow FTP connection
iptable-ftp
Configure SELinux Boolean
chcon
Restart the vsftpd service
vsftpd-restart
Note down the IP address of server
ifconfig
That's all setting we need on server system now go on linuxclient system.

Configure YUM client system in RHEL6

Check connectivity from server
ping-server
Check anonymous login
anonymous-login-sucess
Create a new file /etc/yum.respo.d/client.reop file
client-repo
Set following value and save the file
setting-in-client-repo
Clean all cache
client-yum-clean-all
Make new cache
client-make-cache
To test list all packages
yum-list-all
List all group packages
client-group-list
To do more testing install squid package
client-yum-install-squid
We have successfully configured yum client.

source : http://computernetworkingnotes.com/network-administration/how-to-configure-yum-server-in-rhel6.html

No comments:

Post a Comment