Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

Thanks.

share|improve this question

migrated from stackoverflow.com Jun 9 '11 at 13:07

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

1 Answer 1

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 http://server.example.com/myrepository.

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

curl http://server.example.com/myrepository/our-custom-package.rpm
curl http://server.example.com/myrepository/repodata/repomd.xml

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]
baseurl=http://server.example.com/myrepository
enabled=1
gpgcheck=0

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 http://www.cyberciti.biz/tips/redhat-centos-fedora-linux-setup-repo.html

share|improve this answer

Your Answer

 
discard

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.