Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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/
$
share|improve this question
    
that looks so strange, are you able to install other packages? –  phunehehe Nov 14 '10 at 13:39
    
@phunehehe: no, none. –  Lazer Nov 14 '10 at 14:07
    
Hmm if you cannot install anything then the settings are wrong. I'd go with pbm's answer. –  phunehehe Nov 15 '10 at 0: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. –  Patrick Mar 12 '12 at 13:01
    
@Lazer: is it Red Hat Enterprise Linux? What version? –  pbm Mar 12 '12 at 23:48
show 5 more comments

4 Answers

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.
share|improve this answer
add comment

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.

share|improve this answer
add comment

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
share|improve this answer
1  
There' no git-core package in rhel 5. It's available in EPEL and named git –  Coren Mar 17 '12 at 17:52
    
I assumed it was there, should have checked. Either way, his repo config was incorrect though. –  Yanick Girouard Mar 18 '12 at 13:28
add comment

Have you tried 'yum clean all'?

share|improve this answer
    
@Steve: yes, same error again. –  Lazer Nov 17 '10 at 10:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.