rhel6.5 yum配置centos6.5

来源:互联网 发布:java 生成方法签名 编辑:程序博客网 时间:2024/06/05 10:03

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 成功;


原创粉丝点击