Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Wondering how to create our own CentOS 5 based yum repository? Basically, we want to make rpm packages and then be able to do things like:

yum install our-custom-package
yum remove our-custom-package
yum update our-custom-package


share|improve this question

migrated from Jun 9 '11 at 13:07

This question came from our site for professional and enthusiast programmers.

up vote 4 down vote accepted

On the server, place your .rpm files into /some/directory, then:

yum install createrepo
cd /some/directory
createrepo .

On this server, configure Apache (or other web server) to allow GET access to /some/directory, and all its contents, using a URI such as

You may wish to verify that this works from another machine. Both of these commands should work:


On each client, as root, create a file:

vi /etc/yum.repos.d/myveryown.repo

This file should contain the following text:

[My Very Own Repository]

Note that you can scp the file to all the clients, make it available for web download, or even (as some do) make a separate RPM that installs this file into the correct location on the client.

Finally, on the client:

yum clean all
yum search our-custom-package
yum install our-custom-package
yum remove our-custom-package
yum update our-custom-package

That should get you up and running. There are, of course, a lot of options and a lot of things to consider (like GPG security) at each step.

I also learned a bit from

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.