Yum server configuration in RHEL/CentOS 6x {ftp method}


***********************************************************************************************

•    First of all insert RHEL6 DVD in DVD-ROM & mount it, and then install required pkgs for yum server with vsftpd pkg because yum provide its pkgs via ftp to clients systems.

Pkgs:-

vsftpd-2.2.2-6.el6.i686.rpm
createrepo-0.9.8-4.el6.noarch.rpm
{Dependencies of createrepo }
deltarpm-3.5-0.5.20090913git.el6.i686.rpm & python-deltarpm-3.5-0.5.20090913git.el6.i686.rpm

***********************************************************************************************
OUTPUT

[root@yum6 ~]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:0C:29:49:0A:F4
          inet addr:192.168.1.245  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe49:af4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9 errors:0 dropped:0 overruns:0 frame:0
          TX packets:35 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1280 (1.2 KiB)  TX bytes:4597 (4.4 KiB)
          Interrupt:19 Base address:0x2024

[root@yum6 ~]# mount /dev/cdrom /mnt/
mount: block device /dev/sr0 is write-protected, mounting read-only

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

[root@yum6 ~]# rpm -ivh /mnt/Packages/createrepo-0.9.8-4.el6.noarch.rpm
warning: /mnt/Packages/createrepo-0.9.8-4.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: 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

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

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

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

***********************************************************************************************

•    Copy all rpms from RHEL-6x DVD or copy all the content of RHEL-6x DVD and paste it in ftp home directory which is /var/ftp/ but I choose /var/ftp/pub directory. After this copy comps file & then perform createrepo command.

***********************************************************************************************
OUTPUT

[root@yum6 ~]# cp -rfv /mnt/* /var/ftp/pub/
`/mnt/EULA' -> `/var/ftp/pub/EULA'
`/mnt/GPL' -> `/var/ftp/pub/GPL'
`/mnt/HighAvailability' -> `/var/ftp/pub/HighAvailability'
`/mnt/HighAvailability/Packages' -> `/var/ftp/pub/HighAvailability/Packages'


...
`/mnt/Server/repodata/repomd.xml' -> `/var/ftp/pub/Server/repodata/repomd.xml'
`/mnt/TRANS.TBL' -> `/var/ftp/pub/TRANS.TBL'
[root@yum6 ~]#

[root@yum6 ~]# cp /var/ftp/pub/Server/repodata/21f8a36d9bca1b5b606702c5ce46b65017360348cace161b7910e0dfaa3cb087-comps-rhel6-Server.xml /root/

[root@yum6 ~]# createrepo -vg 21f8a36d9bca1b5b606702c5ce46b65017360348cace161b7910e0dfaa3cb087-comps-rhel6-Server.xml /var/ftp/pub/Packages/
Error: groupfile /var/ftp/pub/Packages/21f8a36d9bca1b5b606702c5ce46b65017360348cace161b7910e0dfaa3cb087-comps-rhel6-Server.xml cannot be found.

[root@yum6 ~]# cp 21f8a36d9bca1b5b606702c5ce46b65017360348cace161b7910e0dfaa3cb087-comps-rhel6-Server.xml /var/ftp/pub/Packages/

[root@yum6 ~]# createrepo -vg 21f8a36d9bca1b5b606702c5ce46b65017360348cace161b7910e0dfaa3cb087-comps-rhel6-Server.xml /var/ftp/pub/Packages/

1/2679 - hdparm-9.16-3.4.el6.i686.rpm
2/2679 - libXft-2.1.13-4.1.el6.i686.rpm
3/2679 - kde-settings-pulseaudio-4.3.1-1.el6.noarch.rpm
4/2679 - hunspell-bg-4.1-5.1.el6.noarch.rpm
5/2679 - kde-l10n-Korean-4.3.4-5.el6.noarch.rpm
6/2679 - libtirpc-0.2.1-1.el6.i686.rpm



2673/2679 - NetworkManager-glib-0.8.1-5.el6.i686.rpm
2674/2679 - qt-4.6.2-16.el6.i686.rpm
2675/2679 - cryptsetup-luks-libs-1.1.2-2.el6.i686.rpm
2676/2679 - cim-schema-2.22.0-2.1.el6.noarch.rpm
2677/2679 - wacomcpl-0.9.0-1.el6.i686.rpm
2678/2679 - pth-2.0.7-9.3.el6.i686.rpm
2679/2679 - kacst-book-fonts-2.0-7.el6.noarch.rpm

Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@yum6 ~]#
[root@yum6 ~]#

***********************************************************************************************

•    Now start vsftpd service & create a *.repo file in /etc/yum.repos.d/ directory.

***********************************************************************************************
OUTPUT

[root@yum6 ~]# /etc/init.d/vsftpd start
Starting vsftpd for vsftpd:                                [  OK  ]
[root@yum6 ~]# /etc/init.d/vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]

[root@yum6 ~]# cat /etc/yum.repos.d/server.repo
[server]
name=pkgs
baseurl=file:///var/ftp/pub/Packages
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[root@yum6 ~]#

***********************************************************************************************

•    Now you can check yum server.

***********************************************************************************************

[root@yum6 ~]# yum list

***********************************************************************************************



0 comments:

Post a Comment

Note: only a member of this blog may post a comment.