old blog,

HOWTO: Creating your own YUM RPM repository

Izhar Firdaus Izhar Firdaus Follow Support Jan 06, 2007 · 1 min read
HOWTO: Creating your own YUM RPM repository
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.
YUM is the default package manager provided with most RPM distros, especially Fedora and Redhat based distros. It is similar to APT of the Debian based distros. Admittedly, it is not the best package manager in term of performance, I personally feels APT is faster and easier to use. However, it do have some good points. One of it is the ease of creating a YUM RPM repositories.

Some users might want to store cached/downloaded RPM packages for backup or future offline use. Some of them might also want to easily resolve dependencies of downloaded RPMs from non-repository sources. By having their own repository, they can easily install the RPMs and avoid dependency hell.

To create our own repo, we use a tool called "createrepo". Its available in the Fedora DVD/CD and you just need to insert the DVD/CD and install it. You can also get it through yum.
yum install createrepo
After you've installed createrepo, dump all of the RPMs you want to create a repo with inside a directory. For the sake of this howto, lets say the directory is '/mnt/storage/myrepo/'.

Then, run createrepo in the directory. More options of createrepo can be found in its manpage.
cd /mnt/storage/myrepo/
createrepo .
After createrepo finished generating the metadata, your repository is ready for use.

To use the repo, you'll need to create a yum configuration for it in /etc/yum.repos.d/. Below is an example of a basic yum configuration.
# file /etc/yum.repos.d/myrepo.repo
name=My Personal Yum Repo

I purposely set "enabled = 0" so that yum won't automatically use the repo by default. This is to avoid conflict between packages from the official repos and your repo. You can explicitly tell yum to use it by using the "--enablerepo=" option.
yum --enablerepo=myrepo install <packagename>

To those who prefer to use APT, the latest APT-RPM tool can use Yum repositories as its repo. Thus making the usage of APT easier on YUM distros.

Thats all folks. Enjoy your new RPM repo. :)
Written by Izhar Firdaus Follow Support
I'm a system architect, data engineer and developer advocate with passion in Free / Open Source software, entrepreneurship, community building, education and martial art. I take enjoyment in bridging and bringing together different FOSS technologies to help businesses and organizations utilize IT infrastructure to aid and optimize their business and organizational process.

"Subscribe Feed" Blogger Widget

This is my first widget written using the HTML widget type. It just a simple widget for users to easily provide buttons to several po...

In old blog, Jan 06, 2007

« Previous Post

There will be no more Fedora Core!!!!

Yup, you didn't read it wrong. Fedora Core will cease to exist, and so do Fedora Extras. Why?. Its because they will be merged togeth...

In old blog, Jan 06, 2007

Next Post »