5

This is what I get

$ sudo yum install git-core
file://localhost/tmp/common1/x86_64/redhat/50/base/ga/Server/repodata/repomd.xml: [Errno 5] OSError: [Errno 2] No such file or directory: '/tmp/common1/x86_64/redhat/50/base/ga/Server/repodata/repomd.xml'
Trying other mirror.
Setting up Install Process
No package git-core available.
Nothing to do
$

What is wrong here?


Update: Current State of the configuration files:

$ cat /etc/yum.conf
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
metadata_expire=0


[base]
name=Red Hat Linux - Base
baseurl=file://localhost/tmp/common1/x86_64/redhat/50/base/ga/Server

$ ls /etc/yum.repos.d/
$
Lazer
  • 35,307
  • Hmm if you cannot install anything then the settings are wrong. I'd go with pbm's answer. – phunehehe Nov 15 '10 at 00:36
  • Deleted my last comment, missed info in your edit. Anyway NJ's answer is correct. If something in the answer isnt working you should elaborate. – phemmer Mar 12 '12 at 13:01
  • @Lazer: is it Red Hat Enterprise Linux? What version? – pbm Mar 12 '12 at 23:48
  • Just out of curiosity, what directory do you expect to get to using file://localhost/tmp/common1/x86_64/redhat/50/base/ga/Server? A local file should be referenced as file:///path/to/file... Why the localhost in there? Do you actually have a directory named localhost in the root of your server??? – Yanick Girouard Mar 13 '12 at 23:34
  • @pbm: Linux 2.6.18-238.0.0.0.1.el5xen – Lazer Mar 14 '12 at 12:18
  • @Lazer: what is the content of /etc/redhat-release? – pbm Mar 14 '12 at 18:25
  • @pbm: Red Hat Enterprise Linux Server release 5.6 (Tikanga) – Lazer Mar 14 '12 at 19:58
  • @Lazer: I edited my answer. I don't have other ideas. Sorry... – pbm Mar 15 '12 at 20:31

4 Answers4

8

Okay, a couple of things here:

Your repo location is apparently file://localhost/tmp/ (I'm not sure about using file://localhost/ but I'm assuming that it's a shortcut for going file:///, but the main issue is the use of /tmp in that path. Files located under /tmp will get cleaned out on reboot (most times). Which will explain later failures.

So, step 1 is restore your local repository (using the same method as you used to create it the first time, I'd recommend a location other than /tmp if you intend on using it again in the future - remember you edit your repository entry in yum.conf or yum.repos.d/ with the new path) or connect it to RHN (I'm assuming based on the directory structure this repo source you are using is of the RHEL 5 GOLD tree).

Once you have the repository setup, you will need to either install git from source, or from EPEL (Extra Packages for Enterprise Linux).

Just to note however:

  1. EPEL packages are built against the latest versions of RHEL, so if you are using 5.0 then you may have dependency conflicts, This is why RHN (subscription required) is the best choice for fixing your repository issue.
  2. If you aren't using RHEL, then you will need to fix your CentOS/OUL/SL repository configurations by hand, however the EPEL steps are equally valid.
N J
  • 2,650
4

I think that something is wrong with repository settings. Check entries in /etc/yum.repos.d/ or /etc/yum.conf or /etc/yum/...

EDIT:

It is obvious that baseurl in base repo is invalid. I was unable to find proper repositories for RHEL 5.6, but according to Wikipedia RHEL 5 is still supported so repositories should be available for 5.6 or at least for 5.8 as this is latest version from line 5.x.

I see two options:

According to Gilles answer in Is CentOS exactly the same as RHEL? you could also try adding CentOS repositories.

I'm not CentOS user but I found following repository config for CentOS:

[base] name=CentOS-5 - Base
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=0

If it return error try to replace $releasever by 5.

pbm
  • 25,387
1

From what you are showing, it looks like you want to use a local copy of the RHEL DVD's Server directory and have yum use that as a local repository. This is common practice when your server is either not connected to the internet, or is not registered with RHN. However, you did it wrong.

Here's how I do it:

  1. Mount the RHEL DVD, and copy the entire Server directory to a sub directory of your choice (other than /tmp). I personally usually use /repo
  2. Create a new repo in /etc/yum.repos.d as follow (name it something like rhel-local-server.repo)

    [rhel-local-server]
    name=RHEL Local Server Repository
    baseurl=file:///repo/Server
    enabled=1
    gpgcheck=1
    
  3. Remove the [base] section you've added in your /etc/yum.conf file, it doesn't belong there.

  4. Run yum clean all

  5. Run yum install git-core
0

Have you tried 'yum clean all'?