linux x86安装yum
1、删除原有YUM
rpm -aq|grep yum|xargs rpm -e --nodeps
2、下载yum安装文件
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-40.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm
3、进行安装yum
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm --replacefiles
rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
4、下载第三方yum源 这里给出网易:wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
下载后的文件放入/etc/yum.repos.d/下面
将下载后的repo文件中所baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/中的所有$releasever改成6
5、执行命令看是否能安装
ping www.baidu.com
yum clean all
yum install gcc-c++