This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Friday, September 25, 2015

How to setup Local Repository Server from Disk image - Linvirtshell

Setup Local Repository Server from Disk image

1.First mount the OS image on server

# mount /dev/cdrom /mnt

2. Copy all the content to local directory

# cp -avf /mnt/* /var/ftp/pub/

3. Watch the size of /var/ftp/pub/ 

#watch du -h /var/ftp/pub

4. Un mount the image

#umount /mnt

5. Copy the grouping files to /root

# cp /var/ftp/pub/Server/repodata/comps-rhel5-server-core.xml /root
# cp /var/ftp/pub/VT/repodata/comps-rhel5-vt.xml /root

6. Remove the group files

# rm -rf /var/ftp/pub/Server/repodata
# rm -rf /var/ftp/pub/VT/repodata

7. Create new group Repository file

# createrepo -g /root/comps-rhel5-Server-core.xml -v /var/ftp/pub/Server
# createrepo -g /root/comps-rhel5-VT.xml -v /var/ftp/pub/VT

8. Remove the default repository files

# rm -rf /etc/yum.repos.d/*

9. Create new repository file (in server)

# vi /etc/yum.repos.d/server-repo

[Server]

name = RHEL SERVER
baseurl = file:///var/ftp/pub/Server
enabled = 1
gpgcheck =0

[VT]

name = RHEL VT
baseurl = file:///var/ftp/pub/VT
enabled = 1
gpgcheck = 0

10. Start the ftp service
#service vsftpd restart

Client Configuration

# vi /etc/yum.repos.d/client.repo

[Server]
name= Client Repo
baseurl = ftp://serverip/pub/Server
enabled = 1
gpgcheck = 0

[VT]
name= Client Repo
baseurl = ftp://serverip/pub/VT
enabled = 1
gpgcheck = 0

  Save and close the config. Run the below command for checking

#yum clean all
#yum list all

No comments:

Post a Comment