Sunday, May 27, 2012

YUM Server configuration Centos 6 and RHEL 6



Advantages of YUM

Automatic resolution of software dependencies. If a package installation or upgrade request is made and requires the installation or upgrade of additional packages, YUM can list these dependencies and prompt the user to install or upgrade them.
Command-line and graphical versions. The command-line version can be run on a system with a minimal number of software packages. The graphical versions offer ease-of-use and a user-friendly graphical interface to software management.
Multiple software locations at one time. YUM can be configured to look for software packages in more than one location at a time.
Ability to specify particular software versions or architectures. Software locations accessible by YUM can contain multiple versions of the same RPM package and different builds for different architectures such as one for i686 and one for x86_64. yum can easily check the appropriate version and download it.
While it's unlikely that you'll have an Internet connection during the exam, you could have a network connection to a local repository. So you should be ready to use the yum command during the Red Hat exam.

Server side configuration:
Step 1:
Install createrepo.rpm from the DVD for creating repository.

[root@server Desktop]# cd /media/CentOS_6.0_Final/Packages/


[root@server Packages]# rpm -ivh vsftpd-2.2.2-6.el6.i686.rpm
warning: vsftpd-2.2.2-6.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:vsftpd                 ########################################### [100%]

[root@server Packages]# service vsftpd restart
Shutting down vsftpd:                                      [FAILED]
Starting vsftpd for vsftpd:                                [  OK  ]


[root@server Packages]# chkconfig vsftpd on


[root@server Packages]# rpm -ivh createrepo-0.9.8-4.el6.noarch.rpm
warning: createrepo-0.9.8-4.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
error: Failed dependencies:
    deltarpm is needed by createrepo-0.9.8-4.el6.noarch
    python-deltarpm is needed by createrepo-0.9.8-4.el6.noarch

Install the dependencies first, if any [eg:deltarpm, python-deltarpm]

[root@server Packages]# rpm -ivh deltarpm-3.5-0.5.20090913git.el6.i686.rpm
warning: deltarpm-3.5-0.5.20090913git.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:deltarpm               ########################################### [100%]


[root@server Packages]# rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.i686.rpm
warning: python-deltarpm-3.5-0.5.20090913git.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:python-deltarpm        ########################################### [100%]


[root@server Packages]# rpm -ivh createrepo-0.9.8-4.el6.noarch.rpm warning: createrepo-0.9.8-4.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:createrepo             ########################################### [100%]

[root@server Packages]# mkdir /var/ftp/yum

Step 2:
Copy all rpm form the DVD and past over the hard disk share them up in NFS.

[root@server Packages]# cp -rv /media/CentOS_6.0_Final/Packages/ /var/ftp/yum/

[root@server Packages]# ls /var/ftp/yum/
Packages

Step3
 To Create Repo
[root@server Packages]# createrepo /var/ftp/
  68/4558 - yum/Packages/atlas-sse3-devel-3.8.3-12.4.el6.i686.rpm
iso-8859-1 encoding on Ville Skytt� <ville.skytta@iki.fi> - 2.8.2-2
4558/4558 - yum/Packages/perl-Time-Piece-1.15-115.el6.i686.rpm                 
Saving Primary metadata
Saving file lists metadata
Saving other metadata

[root@server Packages]# cd /etc/yum.repos.d/

[root@server yum.repos.d]# ls
CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-Media.repo
 Step3:
To Rename Defaults repo 

[root@server yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.old
[root@server yum.repos.d]# mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo.old
[root@server yum.repos.d]# mv CentOS-Media.repo CentOS-Media.repo.old

[root@server yum.repos.d]# ls
CentOS-Base.repo.old  CentOS-Debuginfo.repo.old  CentOS-Media.repo.old
Step4
Create File Repo.base
[root@server yum.repos.d]# vi base.repo

[yum]
baseurl=ftp://10.23.145.1
gpgcheck=0

to Save :wq!

[root@server yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, refresh-packagekit
Repository 'yum' is missing name in configuration, using id
Cleaning up Everything

[root@server yum.repos.d]# yum update all
Loaded plugins: fastestmirror, refresh-packagekit
Repository 'yum' is missing name in configuration, using id
Determining fastest mirrors
yum                                                      | 1.3 kB     00:00    
yum/primary                                              | 1.8 MB     00:00    
yum                                                                   4558/4558
Setting up Update Process
No Match for argument: all
No package all available.
No Packages marked for Update
[root@server yum.repos.d]#

________________________________________________________________________

Yum Client

[root@server Packages]# cd /etc/yum.repos.d/

[root@server yum.repos.d]# ls
CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-Media.repo

[root@server yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.old

[root@server yum.repos.d]# mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo.old

[root@server yum.repos.d]# mv CentOS-Media.repo CentOS-Media.repo.old

[root@server yum.repos.d]# ls
CentOS-Base.repo.old  CentOS-Debuginfo.repo.old  CentOS-Media.repo.old

[root@server yum.repos.d]# vi base.repo

[yum]
baseurl=ftp://10.23.145.1
gpgcheck=0

to Save :wq!

[root@server yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, refresh-packagekit
Repository 'yum' is missing name in configuration, using id
Cleaning up Everything

[root@server yum.repos.d]# yum update all
Loaded plugins: fastestmirror, refresh-packagekit
Repository 'yum' is missing name in configuration, using id
Determining fastest mirrors
yum                                                      | 1.3 kB     00:00    
yum/primary                                              | 1.8 MB     00:00    
yum                                                                   4558/4558
Setting up Update Process
No Match for argument: all
No package all available.
No Packages marked for Update


[root@localhost ~]# vi /etc/yum/pluginconf.d/fastestmirror.conf
 to enable=1 to change enable=0

2 comments:

  1. dear rajesh how to mack yum repo without HTTP,FTP

    kindly help us

    ReplyDelete