May 21, 2011
I have installed CentOS 5.6 guest in vmware. This machine has host-only networking. I would like to install vmware-tools, which requires that gcc be installed. (As vmware tools is not yet configured, I cannot copy paste the error. So I am typing it out). As gcc has dependancies, I thought of configuring a local yum repository via http. http is already up and running fine.These are the steps I did:
View 4 Replies
I mounted the iso as loopback in /mnt/cdrom.
mkdir -p yum/base-pkg
/var/www/html/yum/base-pkg is where all the rpm's going to be served via http will be present. I am changing the ownership of /var/www/html/yum/base-pkg to apache:apache, though not sure if this step is required.
chown -R apache:apache /var/www/html/yum/base-pkg
Now, cd /mnt/cdrom
ls CentOS | wc -l
I am copying these 2684 packages as follows:
cp -avr CentOS/* /var/www/html/yum/base-pkg
I am also copying the directory "repodata" as follows:
cp -R repodata/* /var/www/html/yum/base-pkg
Now, cd /etc/yum.repos.d
ls shows the following files:
I am renaming the .repo directories to something else. I hope this will ensure that yum will not look into the default repositories, rather will look only into my custom repository file.
for i in $(ls); do mv $i $i.org; done
Now I am creating my repository file named mylocal.repo (in /etc/yum.repos.d)
name=Centos $releasever - $basearch