You are here
Home > Redhat > Yum script for Red Hat

Yum script for Red Hat

mount /dev/cdrom /mnt

cd /mnt/Server

rpm -ivh createrepo*

rpm -ivh vsftpd*

cp -rvf /mnt/* /var/ftp/pub

cp /var/ftp/pub/Server/repodata/comps* /var/ftp/pub/Server

cp /var/ftp/pub/VT/repodata/comps* /var/ftp/pub/VT

cd /var/ftp/pub/Server

rm -rf /var/ftp/pub/Sever/.olddata

rm -rf /var/ftp/pub/VT/.olddata

createrepo -vg comps-rhel5-server-core.xml /var/ftp/pub/Server

createrepo -vg comps-rhel5-vt.xml /var/ftp/pub/VT

cd /etc/yum.repos.d/

if [ -f yumserver.repo ]

then

rm -f yumserver.repo

fi

cat >> yumserver.repo <<-EOA

[Server]

name=YumServer

baseurl=file:///var/ftp/pub/Server

gpgcheck=0

[VT]

name=VTServer

baseurl=file:///var/ftp/pub/VT

gpgcheck=0

EOA

(1) copy the above script anywhere on redhat system

(2) put your RHEL5 DVD on rom

(3) change mode of this file (chmod 777 yumscript)

(4) run script ./yumscript

(5) sit back and relax for 15 minutes it will copy all your dvd files to your HDD and create yum file also.

(6) test it by give command (yum install bind)

Leave a Reply

3 × one =

Top