Centos6 安装yum 完美安装(转载)

1. 卸载以前安装包

查看 #rpm -qa | grep yum 

卸载 #rpm -e --nodeps yum

2. 下载包

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-4.el5.x86_64.rpm 
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.22-40.el5.centos.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.2.3-6.el5.noarch.rpm

注意两点:1,先查看下http://mirrors.163.com/centos/6/os/x86_64/Packages下面对应上面包名的版本,替换掉

            2, 可能在公司内部需要设置代理,临时代理直接在每条命令后面加上 -e use_proxy=yes -e http_proxy=IP.PORT

3. 安装包


rpm -ivh python-iniparse-0.2.3-6.el5.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-4.el5.x86_64.rpm
rpm -ivh yum-3.2.22-40.el5.centos.noarch.rpm yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
注意:后面两个有依赖,要一起安装

4,修改源

wget -O /etc/yum.repos.d/CentOS-Base-163.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo

5,yum clean all

    yum makecache

    执行后可能包Error 12 Timeout的错,网上有各种解决办法,我这里最终有效的是修改 yum.conf文件

    把mirrorlist的注释#去掉,这样会找到快速镜像
 

你可能感兴趣的:(linux,环境搭建和安装)