Centos6.6的yum安装(主要为yum和python之间版本号记录)

  1. 先进行卸载
##卸载指令
rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps
whereis python |xargs rm -frv
whereis python 
rpm -qa|grep yum|xargs rpm -ev --allmatches --nodeps
whereis yum |xargs rm -frv
  1. 下载新的安装包并将下面的包分别放入对应的文件夹中
##创建安装包存放的文件夹
mkdir /usr/local/src/python
mkdir /usr/local/src/yum

需要的安装包版本,下载路径去这里https://vault.centos.org国内大多数的下载源只支持7及7以上版本,不好下载,例如我的是32位的6.6版本Centos,那我的路径就是https://vault.centos.org/6.6/os/i386/Packages/

##python部分
python-2.6.6-36.el6.x86_64.rpm
python-devel-2.6.6-36.el6.x86_64.rpm
python-libs-2.6.6-36.el6.x86_64.rpm
python-pycurl-7.19.0-8.el6.x86_64.rpm
python-setuptools-0.6.10-3.el6.noarch.rpm
python-urlgrabber-3.9.1-8.el6.noarch.rpm  
python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm-python-4.8.0-32.el6.x86_64.rpm
##yum部分
yum-3.2.29-40.el6.centos.noarch.rpm
yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
yum-utils-1.1.30-14.el6.noarch.rpm
yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm     
yum-plugin-protectbase-1.1.30-14.el6.noarch.rpm
yum-plugin-aliases-1.1.30-14.el6.noarch.rpm
yum-plugin-downloadonly-1.1.30-14.el6.noarch.rpm
  1. 进行安装
##安装指令
cd /usr/local/src/python
rpm -ivh python-*   rpm-python-* --nodeps --force
cd /usr/local/src/yum
rpm -ivh yum-*
  1. 修改yum安装的数据源,国内大多数的下载源只支持7及7以上版本,7以下版本需要去该下载源下载https://vault.centos.org/6.6/os/i386/Packages/,进去后找到你自己的Centos版本和类型即可
##修改yum的下载源配置文件
vim /etc/yum.repos.d/CentOS-Base.repo

我当初为了急用就比较粗暴的全部修改为绝对路径了,可以参考一下,反正就是改baseurl就是了,如果你也是急用的话就把我下面的6.6改成你的centos版本号也能用,但是不大推荐,还是按照他原本的配置文件格式安全点。

# 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-$releasever - Base - 163.com
#baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
baseurl=https://vault.centos.org/6.6/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#released updates 
[updates]
name=CentOS-$releasever - Updates - 163.com
#baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
baseurl=https://vault.centos.org/6.6/updates/$basearch
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&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-$releasever - Extras - 163.com
#baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
baseurl=https://vault.centos.org/6.6/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&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-$releasever - Plus - 163.com
#baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
baseurl=https://vault.centos.org/6.6/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&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-$releasever - Contrib - 163.com
#baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/
baseurl=https://vault.centos.org/6.6/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值