Create a custom repository in RHEL 5.x

Another note-to-self kind of post. Creating a custom repo on RedHat.


[root@localhost ~]# yum install createrepo
[root@localhost ~]# mkdir -p /opt/acc/repo
[root@localhost ~]# createrepo /opt/acc/repo/

Saving Primary metadata
Saving file lists metadata
Saving other metadata

[root@localhost ~]# tree /opt/acc/repo/
/opt/acc/repo/
`-- repodata
    |-- filelists.xml.gz
    |-- other.xml.gz
    |-- primary.xml.gz
    `-- repomd.xml

Now adding this repo details to the repo-register.

[localrepo]
name=Fedora Core $releasever - My Local Repo
baseurl=file:///mnt/fc_local_repo/
enabled=1
gpgcheck=0
#gpgkey=file:///path/to/you/RPM-GPG-KEY

You can also serve the base url over http in which case the protocol would change from file:/// to http:// or https:///

About rp

Architect for large, highly scalable LAMP applications and Technical Manager with special focus on metrics based continuous improvement of teams and products. Rajat has close to a decade of experience of a very wide range of skills related to infrastructure, middleware, app servers all the way to front-end technologies and software development methodologies including agile, iterative waterfall, waterfall as well as ah-hoc startup using the right approach in the right context to reduce time to market.