0

I am running a linux server using RedHat and Centos 6.4

I need to install gcc onto the server, so I have been trying to use yum to install gcc for me, however I seem to have a bit of an issue with installing and updating packages using yum due to the yum.conf file.

If I open my current yum.conf file, I see the following code:

[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1

[base]
name=Red Hat Linux $releasever - $basearch - Base
baseurl=http://mirror.dulug.duke.edu/pub/yum-repository/redhat/$releasever/$basearch/


[updates]
name=Red Hat Linux $releasever - Updates
baseurl=http://mirror.dulug.duke.edu/pub/yum-repository/redhat/updates/$releasever/

and whenever I try to run a yum command - for example, "yum update" I get the following errors in my terminal:

[root@SERVER etc]# yum update
Gathering header information file(s) from server(s)
Server: Red Hat Linux 6 - x86_64 - Base
retrygrab() failed for:
  http://mirror.dulug.duke.edu/pub/yum-repository/redhat/6/x86_64/headers/header.info
  Executing failover method
failover: out of servers to try
Error getting file http://mirror.dulug.duke.edu/pub/yum-repository/redhat/6/x86_64/headers/header.info
[Errno 4] IOError: <urlopen error >
[root@SERVER etc]# 

I believe this is due to some old yum mirrors being down, however I cannot find any reference to a proper set of repositories to use in my yum.conf file which would work on CentOS 6.4

The question is: does anybody know where I can find a set of repositories that will work in this scenario? I know that the Yum website is now found at http://yum.baseurl.org/ however I cannot see anything clear with regard to what repositories I should be putting in my yum.conf file..

I am obviously a linux newbie, so if I am missing something important, flame me gently...

1 Answer 1

1

Looks like you have a mix of CentOS and RedHat bits. Delete whatever you added. CentOS is easy (examples below). For RedHat if you aren't a registered machine you'll want to use the DVD ISO as source (baseurl=file:///media) or maybe attach to a public EPEL.

Here's a CentOS /etc/yum.conf.

[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum distroverpkg=centos-release

And then you should have a few repos that already exist in /etc/yum.repos.d (base/debuginfo/media/vault). Hers's /etc/yum.repos.d/CentOS-Base.repo

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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