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.

[[email protected] ~]# mkdir /mnt/rhel5

[[email protected] ~]# 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

[[email protected] ~]# mkdir /var/www/html/rhel5

[[email protected] ~]# cp –r /mnt/rhel5/* /var/www/html/rhel5/

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

[[email protected] ~]# cp –r /mnt/rhel5 /var/www/html/

Step-3: Unmount and eject the DVD

[[email protected] ~]# umount /mnt/rhel5/

[[email protected] ~]# 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.

[[email protected] ~]# cd /var/www/html/rhel5/Server/

[[email protected] 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.

[[email protected] ~]# cd /var/www/html/rhel5/
[[email protected] 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

[[email protected] ~]# 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.

[[email protected] ~]# cd /etc/yum.repos.d

[[email protected] ~]# cp rhel-debuginfo.repo  rhel5.repo

[[email protected] 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.


[[email protected] ~]# cd /etc/yum/pluginconf.d

[[email protected] 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.

[[email protected] ~]# yum clean all
[[email protected] ~]# yum update
[[email protected] ~]# yum list
[[email protected] ~]# yum install kernel* gcc* lib* httpd* vsftpd* -y
[[email protected] ~]# 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