How to setup your own package repository. Sometimes you'll find you need to be able to collect a bunch of rpm packages you have together in one place and you want to make them available to your systems running yum. It is pretty easy to do. Steps: 1. collect the packages together in one directory. You can make as many subdirs as you want, but there needs to be a top level dir where they all live. That's where we're going to form our repository. 2. Yum uses a digest of the information stored in each rpm to do its work. You have to create this information using the 'createrepo' program. If you don't have createrepo installed you can install it with: 'yum install createrepo' Once you have it installed you need to run it. It only requires one argument which is the directory in which you would like to generate the repository data. So if the packages dir we made in step 1 is in /srv/my/repo then you would run: createrepo /srv/my/repo You should see a lot of things fly by but it should finish without an error. In the end you should have a directory named /srv/my/repo/repodata with at least 4 files in it. Maybe more. 3. To make this repository known to yum you need to add a .repo file to your yum configuration. On the systems where you want to use this repo you need to make a new file in /etc/yum.repos.d/. The file can be named anything but the extension on the file has to be .repo. Let's call this one 'myrepo.repo'. In the file you just need to include the following: [myrepo] name = This is my repo baseurl = url://to/get/to/srv/my/repo/ That's all you need in that file. The 'baseurl' line is the path that machine uses to get to the repository. If the machine has direct access to it or mounts it as a filesystem you can use a baseurl line like: baseurl = file:///srv/my/repo/ NB: there are 3 slashes (/) following the file:, not 2. That is correct. If you access the file via an http or https server you would use something like: baseurl = http://servername/my/repo 4. Now, everytime you modify, remove or add a new rpm package to /srv/my/repo you need to recreate the repository metadata. You do that the same way you did in step 2. Now, let's get into a few more advanced options of createrepo. 1. createrepo --update: Sometimes you have a lot of packages in it and regenerating all that data for each package when only a few have been added or changed is just time consuming. This is where --update comes in handy. You run createrepo just like you did before but you pass --update to it. Like this: createrepo --update /srv/my/repo Now, createrepo will only update the items which have been changed, been added or been removed. 2. createrepo -x package_file_name: Suppose you have a few packages in your repository directory but you really don't want the unsuspecting world to see them. You can exclude packages easily with createrepo: createrepo -x filename -x filename2 -x filename* /srv/my/repo If you want to learn more about using createrepo to create and maintain your own package repository please see the createrepo man page or the other documents in this collection.