Local Yum Server (Part 2)HARDWARE NETWORKING LINUX SOFTWAREIt Tech Technology

It Tech Technology

COMPUTER HARDWARE NETWORKING

Breaking

Home Top Ad

Post Top Ad

Saturday, January 9, 2016

Local Yum Server (Part 2)




Local Yum Server


Step-1: Mounting the RHEL5 DVD.

Insert the RHEL5 DVD into your DVD-ROM and create a directory under the /mnt/ directory named rhel5 then mount the DVD into /mnt/rhel5/ directory.

[root@yumsrv ~]# mkdir /mnt/rhel5

[root@yumsrv ~]# mount /dev/block device name /mnt/rhel5/

Note: If you are using usb-dvd-rom then your block device name will be scd0, if your device IDE dvd-rom then your device will dvd-hdd, if else you are using SATA dvd-rom then device will be only dvd, but keep remember it that when you are working on Vmware Workstation then you have to use only cdrom.

Step-2: Copy all the files from DVD source.

Create a directory into /var/www/html/rhel5 then copy all the file from /mnt/rhel5 directory and keep into /var/www/html/rhel5 directory

[root@yumsrv ~]# mkdir /var/www/html/rhel5

[root@yumsrv ~]# cp –r /mnt/rhel5/* /var/www/html/rhel5/

Or you can directory copy /mnt/rhel5 directory without creating /var/www/html/rhel5 directory

[root@yumsrv ~]# cp –r /mnt/rhel5 /var/www/html/

Step-3: Unmount and eject the DVD

[root@yumsrv ~]# umount /mnt/rhel5/

[root@yumsrv ~]# eject /dev/block device name

Step-4: Installing createrepo RPM package for creating Repository file for DVD source.

Now go to the mount point directory (var/www/html/rhel5/) and execute the command below for installing the RPM package.

[root@yumsrv ~]# cd /var/www/html/rhel5/Server/

[root@yumsrv Server]# rpm –ivh createrepo-0.4.11-3.el5.noarch.rpm
Warning: createrepo-0.4.11-3.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing…
########################################### [100%]
1:createrepo
########################################### [100%]

Step-5: Creating Repository file.

Now go to the /var/www/html/rhel5/ directory and create repodata file for DVD source.

[root@yumsrv ~]# cd /var/www/html/rhel5/
[root@yumsrv rhel5]# createrepo .

Step-6: Edit yum.conf file.

Now finally tell to yum use this “repo” frile for installing packages. It will automatically done by configuring yum.conf file

[root@yumsrv ~]# vi /etc/yum.conf

[main]

gpgcheck=0

plugins=0

[RHEL5-repository]
name=Red Hat Enterprise Linux Local Repository

baseurl=file:///var/www/html/rhel5

enabled=1

gpgkey=file:///var/www/html/rhel5/RPR-GPG-KEY-redhat-release

Step-7: Create Local debug information.

Now configure the debug information for DVD source by editing rhel-debuginfo.repo file.

[root@yumsrv ~]# cd /etc/yum.repos.d

[root@yumsrv ~]# cp rhel-debuginfo.repo  rhel5.repo

[root@yumsrv yum.repos.d]# vi rhel5.repo

[RHEL5-Debuginfo]
name=Red Hat Enterprise Linux Local Repository Debuginfo

baseurl=file:///var/www/html/rhel5

enabled=1

gpgcheck=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-key-redhat-release

Note: Remove or move the rhel-debuginfo.repo file, otherwise yum will try to use this file.

Step-8: Disable RHN Plug-ins.

Now finally disable the RHN plug-ins and tell to yum that just install the packages.


[root@yumsrv ~]# cd /etc/yum/pluginconf.d

[root@yumsrv pluginconf.d]# vi rhnplugin.conf

[main]
enables=0

gpgcheck=0


[rhel-i386-server-5]
enabled=0

Step-9: Testing the yum server.

Now verify that your Yum is working properly by following this command.

[root@yumsrv ~]# yum clean all
[root@yumsrv ~]# yum update
[root@yumsrv ~]# yum list
[root@yumsrv ~]# yum install kernel* gcc* lib* httpd* vsftpd* -y
[root@yumsrv ~]# yum erase kernel* gcc* lib* httpd* vsftpd* -y

So, now you can install & uninstall your all required packages by using yum command with install & erase command.

Post Bottom Ad