Thursday, 1 December 2011

RHEL 6.1 yum repository

So you have Redhat 6.1 Enterprise installed, but now you need to setup some local repositories from the DVD which the system was created.  So here is a quick guide on how to do it -

First install the createrepo command, else we can create our yum repository.
# rpm -ivh --aid /mnt/Packages/deltarpm-3.5-0.5.20090913git.el6.ppc64.rpm
# rpm -ivh --aid /mnt/Packages/python-deltarpm-3.5-0.5.20090913git.el6.ppc64.rpm
# rpm -ivh --aid /mnt/Packages/createrepo-0.9.8-4.el6.noarch.rpm


Mount the installation DVD.
# mount /dev/dvd /mnt

Copy over the packages to a folder.
# mkdir /etc/yum.repos.d/rhel6.1
# cp /mnt/Packages/* /etc/yum.repos.d/rhel6.1

When you copy over the files you will also find a *.xml library file, either in the same dir as the source or in a sub that needs to be copied over for the next command.
Create the repo with the createrepo command.
# createrepo -g repomd.xml /etc/yum.repos.d/rhel6.1

Create the repo file.
vi /etc/yum.repos.d/rhel61.repo
[RHEL-Repository]
name=RHEL 6.1
baseurl=file:///etc/yum.repos.d/rhel6.1
enabled=1
gpgcheck=0

Update yum's repo list.
# yum clean all
Loaded plugins: product-id, subscription-manager
Updating Red Hat repositories.
RHEL-Repository                                              | 1.3 kB     00:00 ...
RHEL-Repository/primary                                      | 1.5 MB     00:00 ...
RHEL-Repository                                                           3210/3210
repo id                                repo name                             status
RHEL-Repository                        RHEL 6.1                              3,210
repolist: 3,210

Then test.
# yum search httpd
Loaded plugins: product-id, subscription-manager
Updating Red Hat repositories.
======================== N/S Matched: httpd =======================================
httpd.ppc64 : Apache HTTP Server
httpd-devel.ppc : Development interfaces for the Apache HTTP server
httpd-devel.ppc64 : Development interfaces for the Apache HTTP server
httpd-manual.noarch : Documentation for the Apache HTTP server
httpd-tools.ppc64 : Tools for use with the Apache HTTP Server
mod_dav_svn.ppc64 : Apache httpd module for Subversion server
mod_dnssd.ppc64 : An Apache HTTPD module which adds Zeroconf support

  Name and summary matches only, use "search all" for everything.

No comments:

Post a Comment