Friday, January 31, 2014

How to Configure yum server on Red Hat Enterprise Linux 5



 Yellow dog Updater, Modified (YUM) server:

Yum is the easiest way to keep all programs up to date. It downloads and installs the latest version of a program. A single command can update all software installed, including third-party software, security updates and operating system. For this we install yum and make it to do all the above.
Yum works in a safe, standardized way. It uses rpm (Red Hat package manager) for installing programs. Authenticity of packages is checked with strong gpg encryption. Package repositories are just folders on a yum server (your local machine) or web server.

Configuring yum server: To configure yum server we need to insert the RHEL5 DVD or cd into the DVD-ROM of your machine and open the gnome-terminal to type these commands. 

[root@localhost ~]# cd /media/RHEL_5.1\ i386\ DVD/Server/
[root@localhost Server]# rpm -ivh createrepo-0.4.4-2.fc6.noarch.rpm
warning: createrepo-0.4.4-2.fc6.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:createrepo             ########################################### [100%]
[root@localhost Server]# rpm -ivh vsftpd-2.0.5-10.el5.i386.rpm
warning: vsftpd-2.0.5-10.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:vsftpd                 ########################################### [100%]
[root@localhost Server]# cd
[root@localhost ~]# cp -rv /media/RHEL_5.1\ i386\ DVD/Server/ /var/ftp/pub/server
[root@localhost ~]# cp -rv /media/RHEL_5.1\ i386\ DVD/VT/   /var/ftp/pub/
[root@localhost ~]# vi /etc/yum.repos.d/server.repo/   -->(this cmd opens file)
                  ******************
(press key 'i'to edit the following lines in the file)

[server]
name=server.repo
baseurl=file:///var/ftp/pub/server
enabled=1
gpgcheck=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

 (press Esc)
:wq!   
(to save & exit from file)

[root@localhost ~]# service yum-updatesd restart
Stopping yum-updatesd:                                     [  OK  ]
Starting yum-updatesd:                                     [  OK  ]
[root@localhost ~]# yum clean all  -->(cmd checks if any errors in configuration of yum server & cleans all cache memory)
[root@localhost ~]# yum install (package name)* -->(cmd to install pkg through yum server)

Hence you have configured yum serve successfully, now you can install any package you desired with a single commend.

No comments:

Post a Comment