rhel6.5 yum配置主要步驟
1.删除redhat原有的yum
rpm -aq|grep yum|xargs rpm -e --nodeps
2.下載下傳yum安裝檔案(檢視系統版本uname -r /uname -p cat /etc/issue)
python-iniparse-0.3.1-2.1.el6.noarch.rpm
yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
yum-3.2.29-40.el6.centos.noarch.rpm
yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
3.配置repo檔案,放到/etc/yum.repos.d/下(從http://mirrors.163.com/.help/CentOS6-Base-163.repo下載下傳)
編輯檔案,把檔案裡面的$releasever全部替換為版本号,即6.5 最後儲存!或者直接把下面的記憶體拷貝到CentOS6-Base-163.repo檔案中即可
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-6 - Base - 163.com
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.5&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-6 - Updates - 163.com
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.5&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-6 - Extras - 163.com
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.5&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6 - Plus - 163.com
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.5&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-6 - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.5&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
4.yum clean all沒有問題 yum makecache報錯 rhel6.5 Couldn't resolve host 'mirrors.163.com
5.檢查網絡ping www.baidu.com不通,斷定是網絡問題,關防火牆,設定DNS,虛拟機 橋接模式改為自定義,
cat /etc/sysconfig/network-scripts/ifcfg-eth0/eth1都設定本地電腦的DNS
6 成功;