I. Make directory /dvd by using following command. This is the mount point for /dev/hdc (this my DVD rom connected at secondary master).
II.Mount using following command
mount /dev/hdc /dvd
III. Need to copy all rpm’s from CD or DVD to /var/ftp
#cp –a /dvd/Centos/* /var/ftp
IV. For creating repodata we need to download createrepo rpm. Following command to download from terminal.Or use browser to download click HERE. To get the latest release click Here.
# wget http://packages.sw.be/createrepo/createrepo-0.4.6-1.el5.rf.noarch.rpm
#rpm –UVH createrepo-0.4.10-1.el5.rf.noarch.rpm
# rpm –Uvh http://packages.sw.be/createrepo/createrepo- 0.4.6-1.el5.rf.noarch.rpm
V.Once installed use the following command to create the repodata files
VI.Once above done. Move *.repo files from the
#mv /etc/yum.repos.d/* /root/Desktop
Centos 5:The reason to move is if you don’t have Internet connection when you installing package with yum, which try to resolve the base centos repository file which is located in /etc/yum.repos.d/Centos-xxxx.repo. So it will not install rpm from local repository Above movement helped to install rpm from local repository.If you have Internet connection move it back to original and install rpm with yum.
VII.Edit the /etc/yum.conf file put the following lines at the end.
name= My Local Repository
baseurl=ftp://youripaddress —-> for Centos 5
VIII.Clean up previous caching by following command. This is important when you are changing repo files or rpm on your repository.
#yum clean all
IX.Install rpm with the following command.
#yum install httpd