9

I need to create a local repository in RHEl 5.5. i386

Because when I type some command in terminal it say that RHEL is not subscribed with RHN which is true. I took it from friend.

So can someone tell me how to achieve this target.

Further Actions based on Warl0ck instructions.

  • I copied the RPM's from Mdia to /home/Umair/RPM folder
  • I installed the script createrepo-0.4.11-i386.el5.noarch.rpm located in Server directory of Installation Media. Then it took some time to generate metadata. Total Packages 2348

Metadata

  • Then I create the local repo file using vi

vi /etc/yum.repos.d/local.repo

These are the entries I added.

Repo text

And finally i run this command

yum -y install apache php{,-cgi,-cli,-gd,-mysql} mysql{,-server}

and in reply bash slapped me with error

erro

5
  • 1
    "I took it from friend.". But... why?! There are two perfectly good alternatives that don't cost money and are (mostly) the same thing. Oct 10, 2012 at 22:50
  • U must be talking about CentOS and Fedora Am I right??? But i will also give them a try.... Thanks
    – OmiPenguin
    Oct 14, 2012 at 8:38
  • One of them is CentOS. The other one is not Fedora. Oct 14, 2012 at 9:07
  • Then what is other one. Isn't it the Fedora because its the Test ground for Redhat????
    – OmiPenguin
    Oct 14, 2012 at 10:22
  • Just to make it three: Scientific Linux, Oracle-Linux, CentOS
    – Nils
    Oct 21, 2012 at 20:18

3 Answers 3

11

There're plenty of documents out there, given a set of RPM packages, you could do something like this,

First install the createrepo script, by

rpm -ivh /path/to/mounted/cdrom/createrepo*.rpm (Depends where you mounted your RedHat DVD)

Now create a folder to hold all RPMS that you want to be in the repository, e.g RPMS, and put the needed "*.rpm" files inside,

Then do createrepo /path/to/RPMS to generate metadata.

When finished, add the repository to your yum config, e.g put the following to /etc/yum.repos.d/local.repo

[local]
name=Local Repository Demo
baseurl=file:///absolute/path/to/RPMS
enabled=1
gpgcheck=0
protect=1
5
  • dear I followed ur instructions but no use it didn't work kindly view the actions which I added in original text under the Heading Further Actions based on Warl0ck instructions.
    – OmiPenguin
    Oct 14, 2012 at 9:14
  • @UmairMustafa maybe the path should be file:///home/Umair/ in this case, I didn't try this out yet, maybe the metadata is stored in the parent folder of RPMS.
    – daisy
    Oct 14, 2012 at 9:19
  • Finally i did it. But this time instead of copying rpms to /home/Umair /RPMS folder I created a folder in /media/RPMS and 2:createrepo /media/rpms and then created the local repo file and finally YUM LIST ALLand then i installed the above mentioned packages
    – OmiPenguin
    Oct 15, 2012 at 8:17
  • For me the whole thing already fails in the first step because createrepo depends on other packages. Aug 12, 2013 at 15:06
  • Your answer is for local repository, I need this repository over my local network implement by nginx web service. How to make repository with nginx?
    – shgnInc
    Sep 11, 2014 at 6:41
3

The first thing you need to do is:

Either (not both) of:

  1. Pay for a Red Hat subscription for the machine.
  2. Convert the system to CentOS.

Then you should find that you are able to access software and complete your task.

0
1
  1. Install create repo

    # cd /media/(dvd-label)
    # cd /Packages
    # rpm -ivh createrepo*.rpm
    
  2. Copy all contents from dvd or just the packges

    • If whole dvd is copied, no need to run createrepo. Because repository is inbuilt in dvd. (To check, see if there is a repodata directory)
    • If package dir is only copied, run

      # createrepo <dir where the packages are copied>
      
  3. Create yum repo file:

    vim dvd.repo
    [packages]
    name=packages
    baseurl=file://<dir where the packages are copied>
    enabled=1
    gpgcheck=0
    +++++++++++++++++++++++++++++++++++++++++
    [packages] -- Give a name, any name
    name=packages -- description for above
    baseurl       -- location where rpms are available
    enabled=1     -- to enable this repo
    gpgcheck=0    -- not to check for GPG license file
    
1
  • Its been Two years since I ask for help and help is what I got, my man. I was very very noob at that time. Learned alot from community there is always a room to learn new thing.
    – OmiPenguin
    Aug 13, 2014 at 10:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .