Home Linux DistributionsCentOS Setup Local YUM Server in CentOS 6

Setup Local YUM Server in CentOS 6

By sk
180 Views
Yellowdog updater, Modified (Yum) is a software package manager that installs, updates and removes packages on RPM-based Linux distributions. Yum makes it easier to maintain groups of machines without having to manually update each one using rpm.

Features

  • Support for multiple repositories.
  • Simple configuration.
  • Automatic dependency calculation.
  • Fast operation.
  • RPM-consistent behavior.
  • Package group support, including multiple-repository groups.
  • Simple interface.

Let us install a local yum server using CentOS 6.3. The steps provided here are tested in CentOS 6.3. But it will work fine in RHEL 6.x and Scientific Linux 6.x too.

In this example the hostname of the server is myserver.ostechnix.com and IP Address is 192.168.56.101.

Login to your system and Mount the contents of your CentOS 6.3 DVD in the /mnt directory or wherever you want. In the Terminal window, type the following command:

# mount /dev/cdrom1 /mnt/
(Here cdrom1 is my local cdrom device)
Install vsftpd package, so that we can use this as a FTP server to share our repository in the client systems.
Change to the directory where you mounted CentOS DVD. In our example we have mounted the CentOS DVD in /mnt directory.

# cd /mnt/Packages
# rpm -ivh vsftpd-2.2.2-11.el6.i686.rpm

Start the FTP Service:

# service vsftpd start
Install createrepo package if it is not installed. This is package is used to create our local repository.
# rpm -ivh createrepo-0.9.8-5.el6.noarch.rpm
Oops!! It shows us the dependency problem. Let us the install missing dependencies first:
# rpm -ivh deltarpm-3.5-0.5.20090913git.el6.i686.rpm
Then install the another one:
# rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.i686.rpm

Now install the createrepo package:

Create a folder called localyumserver (You can use your own) in /var/ftp/pub directory to save all the packages from the CentOS DVD. Copy all the files in the Packages folder from the DVD to /var/ftp/pub/localyumserver folder:

# mkdir /var/ftp/pub/localyumserver
# cp -ar *.* /var/ftp/pub/localyumserver
It will take a while to copy all the packages in the DVD. Please be patient. After all packages are copied, create a repo file called localyumserver.repo in /etc/yum.repos.d/ directory.
# nano /etc/yum.repos.d/localyumserver.repo

Type the following entries and save the file (CTRL+O to save and CTRL+X to exit):

Where,
[localyumserver] ==> Name of the Local Repository.
comment ==> Information about the Repository.
baseurl ==> Path of the Repository (i.e where we had copied the contents from CentOS DVD)
gpgcheck ==> Authentication of the Repository, which is disabled in our case.

Now it is time to create our repository. Enter the following command in the Terminal:

# createrepo -v /var/ftp/pub/localyumserver

Now the local YUM repository creation process will begin.

Note: Delete or rename all the other repo files except the newly created repo file i.e in our example it is localyumserver.repo

Next update the repository:
yum clean all
yum update

You're done now.

Client side configuration

Create a repo file in your client system as mentioned above in the /etc/yum.repos.d/ directory and remove or rename the existing repositories. Then modify the baseurl as mentioned below:

[localyumserver]
comment ="My Local Repository"
baseurl=ftp://myserver.ostechnix.com/pub/localyumserver
gpgcheck=0
enabled=1

(or)

[localyumserver]
comment ="My Local Repository"
baseurl=ftp://192.168.56.101/pub/localyumserver
gpgcheck=0
enabled=1

Thats it. Start using Yum. Enjoy!!

You May Also Like

26 comments

sivam April 15, 2013 - 2:18 pm

wow Thank you man I have configured Yum from your guide .Thanks

Thanks alot

Reply
vinod June 11, 2013 - 12:29 pm

not working please help me.where to type ‘yum clean all’ and ‘yum update’ in server or client

Reply
SK June 11, 2013 - 10:31 pm

Try these commands on both systems. It should work.

Reply
upraju April 25, 2013 - 9:18 am

Thanks. it works…

Reply
Quality Golden Retriever Cocker Spaniel Mix Puppies Stuff May 10, 2013 - 3:01 pm

Wonderful beat ! I would like to apprentice even as you amend your web
site, how can i subscribe for a blog website? The account helped me a
applicable deal. I were a little bit familiar of this your broadcast provided bright transparent concept

Reply
polo ralph lauren outlet May 10, 2013 - 6:40 pm

Tremendous issues here. I am very satisfied to see your post.
Thank you a lot and I’m looking forward to contact you. Will you kindly drop me a e-mail?

Reply
acoustical treatments May 12, 2013 - 1:00 am

Hi there to all, the contents existing at this web site are in fact awesome for
people knowledge, well, keep up the good work fellows.

Reply
SK May 12, 2013 - 9:07 am

Thanks.

Reply
cskgkp May 21, 2013 - 4:47 pm

gentle man , how we can install a group package from this yum server

Reply
SK May 21, 2013 - 10:40 pm

Hi

Refer the following link about group install.

http://thevagabondgeek.com/5-centos-yum-groupinstall-basics

Reply
buy Xanax May 28, 2013 - 2:34 pm

Howdy! This article couldn’t be written much better! Looking at this post reminds me of my previous roommate! He continually kept preaching about this. I will forward this post to him. Fairly certain he will have a very good read. Thank you for sharing!

Reply
Cairns Tours May 29, 2013 - 5:49 am

Good article! We are linking to this great article on our website.
Keep up the great writing.

Reply
Bebe May 29, 2013 - 9:35 am

This is a great tip especially to those fresh to the blogosphere.
Simple but very accurate information… Many thanks for sharing this one.
A must read article!

Reply
Weblinx reviews May 29, 2013 - 2:45 pm

I feel this is among the most important info for me.
And i am happy studying your article. However wanna remark on few general things, The
web site taste is wonderful, the articles is truly great : D.
Excellent activity, cheers

Reply
Koszulki reklamowe May 30, 2013 - 2:40 am

This is really fascinating, You are a very professional blogger.
I have joined your feed and look forward to in search of
more of your wonderful post. Additionally, I have shared your website
in my social networks

Reply
nike free run sale May 31, 2013 - 9:20 am

Hey there! This is kind of off topic but I need some guidance
from an established blog. Is it very difficult to set up your own blog?

I’m not very techincal but I can figure things out pretty fast. I’m thinking about making my own but I’m not sure where to start. Do you have any points or suggestions? Many thanks

Reply
SK May 31, 2013 - 2:51 pm

Its not that difficult. Very easy and free..You can try wordpress and blogger. Good luck.

Reply
weblinx apps May 31, 2013 - 8:06 pm

Hey there! Someone in my Myspace group shared this site with us so I came to
take a look. I’m definitely enjoying the information. I’m book-marking and will be tweeting this to my followers!
Superb blog and outstanding style and design.

Reply
Danelle June 5, 2013 - 5:05 am

This is really attention-grabbing, You’re a very professional blogger. I’ve joined your rss feed and look ahead to seeking extra of your excellent post.
Additionally, I have shared your web site in my social networks

Reply
Luis June 25, 2013 - 4:19 am

Outstanding post! I had to allow port 21 on the server’s firewall for the client to work, but other than that your post was spot on. Thank you for sharing.

Reply
Rakesh July 5, 2013 - 2:26 pm

great one .thanks hope I will get more information from this site

Reply
karthik January 23, 2014 - 3:39 pm

Hey brother you are just awesome man.. I have never seen such a great explanation on anyother site in earth for linux… you are fantastic man… Thank you so much man….

Reply
karthik January 24, 2014 - 12:16 pm

Brother you are awesome man, just love it man….

Reply
Zakir Hossain January 30, 2014 - 9:04 pm

It is working.
Thanks

Reply
abduljaleel29 February 21, 2014 - 1:22 pm

It is working ..Thanks a lot man.wasted one day by following some irrelevant pages.Thanks again for the easy and working steps 🙂

Reply
Kostas October 7, 2015 - 6:47 pm

It is interesting, thanks.

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More