Tuesday, 26 May 2015

Step by Step : How to configure YUM Server in RHEL6


Make directories yum/rhel6/repodata in the folder which you have chosen for repository.

For FTP server it would be /var/ftp/pub folder

[root@dpdcdb repodata]# mkdir -p /var/ftp/pub/yum/rhel6/repodata/

Copy all RPM from RHEL 6 DVD located in Packages folder to [root@dpdcdb repodata]#

[root@dpdcdb repodata]# cp -arf /media/RHEL_6.2\ x86_64\ Disc\ 1/Packages/*.rpm /var/ftp/pub/yum/rhel6/repodata/


root@dpdcdb repodata]# cp /media/RHEL_6.2\ x86_64\ Disc\ 1/repodata/*comps*.xml /var/ftp/pub/yum/rhel6/repodata/comps.xml
[root@dpdcdb repodata]#

[root@dpdcdb RHEL_6.2 x86_64 Disc 1]# cd Server/
[root@dpdcdb Server]# rpm -qa deltarpm
[root@dpdcdb Server]# rpm -qa python-deltarpm
[root@dpdcdb Server]# rpm -qa createrepo
[root@dpdcdb Server]# pwd
/media/RHEL_6.2 x86_64 Disc 1/Server
[root@dpdcdb Server]#
[root@dpdcdb Server]# cd /var/ftp/pub/yum/rhel6/repodata/
[root@dpdcdb repodata]# rpm -ivh deltarpm*
warning: deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:deltarpm               ########################################### [100%]
[root@dpdcdb repodata]#
[root@dpdcdb repodata]# rpm -ivh python-deltarpm*
warning: python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:python-deltarpm        ########################################### [100%]
[root@dpdcdb repodata]#
[root@dpdcdb repodata]# rpm -ivh createrepo*
warning: createrepo-0.9.8-4.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:createrepo             ########################################### [100%]
[root@dpdcdb repodata]#

[root@dpdcdb repodata]# rpm -qa createrepo
createrepo-0.9.8-4.el6.noarch
[root@dpdcdb repodata]# rpm -qa python-deltarpm
python-deltarpm-3.5-0.5.20090913git.el6.x86_64
[root@dpdcdb repodata]# rpm -qa deltarpm
deltarpm-3.5-0.5.20090913git.el6.x86_64
[root@dpdcdb repodata]#

Change directory to /var/ftp/pub/yum/rhel6

[root@dpdcdb repodata]# cd ../
[root@dpdcdb rhel6]# ll
total 248
drwxr-xr-x. 2 root root 253952 May 26 15:50 repodata
[root@dpdcdb rhel6]#

Generate local repository files from repodata folder [ repodata folder :- which contain all RPM copied from RHEL6 DVD] to current folder [rhel6]

[root@dpdcdb rhel6]# createrepo -g repodata/comps
comps-extras-17.8-1.el6.noarch.rpm  comps.xml

[root@dpdcdb rhel6]# createrepo -g repodata/comps.xml .
 979/3596 - repodata/oxygen-icon-theme-4.3.4-2.el6.noarch.rpm
iso-8859-1 encoding on Ville Skyttä - 2.8.2-2

3596/3596 - repodata/qpid-cpp-client-0.12-6.el6.i686.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@dpdcdb rhel6]#


[root@dpdcdb rhel6]# vim /etc/yum.repos.d/server.repo

[server]
name=rhel6
baseurl=file:///var/ftp/pub/yum/rhel6
enabled=1
gpgcheck=0


[root@dpdcdb rhel6]# vim /etc/yum.repos.d/server.repo
[root@dpdcdb rhel6]# yum clean all
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Cleaning repos: InstallMedia server
Cleaning up Everything
[root@dpdcdb rhel6]#


[root@dpdcdb rhel6]# yum makechace
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
No such command: makechace. Please use /usr/bin/yum --help
[root@dpdcdb rhel6]#

No comments:

Post a Comment