Create CentOS 6 Local package and Group package Repository

Create CentOS 6 Local package and Group package Repository.

Prerequisites:

> CentOS 6 .iso file or DVD.
> Installed CentOS 6.5 / 6.6 x86_64 server with minimum 40 GB free disk space on / partition.
> Make sure Internet is enabled on Linux server to download and install few packages.

Steps to create Local package repository: 

> Copy CentOS 6.5 .iso file in Linux Centos 6 x86_64 server on / partition.

> Mount CentOS 6.5 .iso file ( CentOS-6.5-x86_64-bin-DVD1.iso ) to /mnt directory
Command: #mount -t iso9660 -o loop /CentOS-6.5-x86_64-bin-DVD1.iso /mnt




 > Install HTTP service on Linux server.
Command: #yum install httpd





> Start HTTP service .
Command: #service httpd restart





> Create Directory centos65 in /var/www/html/ 
Command: #mkdir /var/www/html/centos65



>  Go to /mnt/Packages directory
Command: #cd /mnt/Packages





> Copy all the files from Packages directory to /var/www/html/centos65/ directory.
Command: #cp -avr * /var/www/html/centos65/



> Install createrepo package.
Command: #yum install createrepo

 

> Go to /var/www/html/ directory.
Command: #cd /var/www/html



> Create repo data on centos65 directory.
Command: #createrepo --database ./centos65/



> Enable httpd service in Linux boot.
Command: #chkconfig httpd on



> Restart httpd service.
Command: #service httpd restart



> Go to yum.repos.d directory.
Command: #cd /etc/yum.repos.d/



> Delete all the files from yum.repos.d directory
Command: #rm -fr *



> Create new CentOS-Base.repo file in yum.repos.d directory.
Command: #vi CentOS-Base.repo

> Add the following lines in CentOS-Base.repo file. Once done save and exit.
Note: 100.64.214.184 is my Linux server IP. Use your Linux server IP at the place of 100.64.214.184.



:wq       ----- Save the file and exit

> Check yum local repository
Command: #yum repolist

 

Base repolist is created now. I have marked in Yellow text in above diagram.

 Steps to create Group package repository: 

Note: 1 to 5 Steps are repeated. and no need to do it again if already configured Base local repository. 

> Copy CentOS 6.5 .iso file in Linux Centos 6 x86_64 server on / partition.

 > Mount CentOS 6.5 .iso file ( CentOS-6.5-x86_64-bin-DVD1.iso ) to /mnt directory
Command: #mount -t iso9660 -o loop /CentOS-6.5-x86_64-bin-DVD1.iso /mnt




 > Install HTTP service on Linux server.
Command: #yum install httpd



> Start HTTP service .
Command: #service httpd restart



> Create group directory in /var/www/html/
Command: #mkdir /var/www/html/group




> Go to /mnt directory.
Command: #cd /mnt



> Copy all the contains of /mnt directory to group directory.
Command: #cp -pfr * /var/www/html/group/




> Go to repodata directory.
Command: #cd /mnt/repodata



> List the contains of repodata directory.
Command:#ls



We need .xml line at the time of create group repo. On the above screen I have marked the .xml line with yellow text.
 
>  Go to /var/www/html/group directory.
Command: #cd /var/www/html/group



> Run the createrepo command on repodata directory.
Command: #createrepo -g  repodata/b4e0b9342ef85d3059ff095fa7f140f654c2cb492837de689a58c581207d9632-c6-x86_64-comps.xml



> Go to yum.repos.d directory.
Command: #cd /etc/yum.repos.d/



> Edit CentOS-Base.repo file
Command: #vi CentOS-Base.repo

> Add the following lines in CentOS-Base.repo file which are marked in Yellow text in following screenshot. Once done save and exit.
Note: 100.64.214.184 is my Linux server IP. Use your Linux server IP at the place of 100.64.214.184.

 


:wq       ----- Save the file and exit.


> Check yum group repository
Command: #yum grouplist

The output will be like following screen.






EOF


Comments

  1. I would be very thankful if you continue with quality what you are serving right now with your blog...I really enjoyed it...and i really essay writing serivce appreciate to you for this....its always pleasure to read so....Thanks for sharing!!!

    ReplyDelete

Post a Comment

Popular posts from this blog

KVM Live Migration without Shared Storage

Create Linux ( LUCI ) Cluster