1、修改网络配置文件,保证能够联网
将网路链接模式改为:桥接模式
# vi /etc/sysconfig/network-scrips/ifcfg-bond0 DEVICE=bond0 #HWADDR=00:50:56:3B:0E:3A TYPE=Ethernet ONBOOT=yes #NM_CONTROLLED=yes BOOTPROTO=none IPADDR=192.168.1.132 NETMASK=255.255.255.0 GATEWAY=192.168.1.1
2、删除当前系统已安装的yum包
# rpm -qa | grep yum | xargs rpm -e --nodeps
3、上传yum包
# cd /opt/soft # wget # wget # wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm # wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
4、安装yum包
# rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm # rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm # rpm -ivh yum-3.2.29-69.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm #两个安装包需要一起安装
5、修改配置文件
# cd /etc/yum.repo.d # mv rhel-source.repo /opt/bak/rhel-source.repo.bak # vi rhel-debuginfo.repo [base] name=CentOS-$releasever - Base baseurl=http://mirrors.163.com/centos/6/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6 #released updates [updates] name=CentOS-$releasever - Updates baseurl=http://mirrors.163.com/centos/6/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6 #packages used/produced in the build but not released #[addons] #name=CentOS-$releasever - Addons #baseurl=http://mirrors.163.com/centos/$releasever/addons/$basearch/ #gpgcheck=1 #gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras baseurl=http://mirrors.163.com/centos/6/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/ gpgcheck=1 enabled=0
6、验证
# yum clean all # yum list #查看是大量包
至此,yum网络源配置成功。
本文出自 “11382081” 博客,请务必保留此出处http://11392081.blog.51cto.com/11382081/1784063
原文地址:http://11392081.blog.51cto.com/11382081/1784063