2014-02-18 40 views
0

我使用的是RedHat和CentOS 6.4庫在CentOS的不工作的yum.conf杆6

我需要安裝GCC到服務器正在運行Linux服務器,所以我一直在嘗試用yum安裝gcc我,但是由於yum.conf文件的緣故,我似乎在使用yum安裝和更新軟件包時遇到了一些問題。

如果我打開我目前的yum.conf文件,我看到了下面的代碼:

[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/ 

,每當我嘗試運行百勝命令 - 例如,「百勝更新」我得到了以下錯誤我的終端:

[[email protected] 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 > 
[[email protected] etc]# 

我相信這是由於一些老百勝鏡子是下降,但是我找不到合適的集倉庫的任何引用我的yum.conf文件中使用這將在CentOS 6.4

工作

問題是:有人知道我可以在哪裏找到一組將在此場景中工作的存儲庫?我知道,百勝網站在http://yum.baseurl.org/但是我什麼都看不到明確的關於什麼庫我應該在我的yum.conf文件中把現在發現..

我顯然是一個Linux新手,所以如果我的思念一些重要的東西,輕輕點燃我......

回答

1

看起來你有一個CentOS和RedHat位的混合。刪除你添加的內容。 CentOS很簡單(下面的例子)。對於RedHat,如果您不是註冊機器,您需要使用DVD ISO作爲源代碼(baseurl = file:/// media)或者可以附加到公共EPEL。

這裏是一個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 

然後,你應該已經在/etc/yum.repos.d存在一些回購(基地/ debuginfo軟/媒體/庫)。她的/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