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 createrepoAfter 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/After createrepo finished generating the metadata, your repository is ready for use.
createrepo .
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
[myrepo]
name=My Personal Yum Repo
baseurl=file:///mnt/storage/myrepo/
enabled=0
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. :)