CentOS升级Python的方法
centOS内核版本为:3.10.101-1.el6.elrepo.x86_64
1,下载Python安装包
wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz
2,解压
tar -xzf Python-2.7.6.tgz
3,安装
cd Python-2.7.6 ./configure make && make install
默认安装路径/usr/local/bin
4,建立软连接,更改系统默认版本
mv /usr/bin/python /usr/bin/python.bak ln -s /usr/local/bin/python2.7 /usr/bin/python
5,验证Python版本
python -V
6,修复yum工具
vi /usr/bin/yum
看到yum内容如下:
#!/usr/bin/python import sys try: import yum except ImportError: print >> sys.stderr, """\ There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: %s Please install a package which provides this module, or verify that the module is installed correctly. It's possible that the above module doesn't match the current version of Python, which is: %s If you cannot solve this problem yourself, please go to the yum faq at: http://yum.baseurl.org/wiki/Faq """ % (sys.exc_value, sys.version) sys.exit(1) sys.path.insert(0, '/usr/share/yum-cli') try: import yummain yummain.user_main(sys.argv[1:], exit_code=True) except KeyboardInterrupt, e: print >> sys.stderr, "\n\nExiting on user cancel." sys.exit(1)
修改第一行 #!/usr/bin/python 为 #!/usr/bin/python2.6(我的系统默认版本为2.6)
CentOS升级Python的方法的更多相关文章
- VPS 的 CentOS6 升级 Python 的方法
VPS 的 CentOS6 升级 Python 的方法 centos默认安装python2.6.由于python和centos关联紧密,所以不建议卸载,进行编译升级 1.新开的VPS务必系统更新 yu ...
- Centos 升级 python
昨天把redmine的测试环境给搞Over了,想了下,干脆直接把环境给整成docker化的,配置环境的时候,安装docker-compose需要python2.7支持. CentOS 6 系统默认 P ...
- 【转】Centos升级Python 2.7.12并安装pip、ipython
Centos系统一般默认就安装有Python2.6.6版本,不少软件需要2.7以上的,通过包管理工具安装不了最新的版本,通过源码编译可以方便安装指定版本,只需要把下面版本的数字换成你想要的版本号. 1 ...
- liunx CentOS 升级Python版本
CentOS python版本是V2.6.6,升级3.4.3. 1.下载 安装包:wget http://www.python.org/ftp/python/3.4.3/Python-3.4.3.tg ...
- CentOS升级内核的方法
升级前的内核版本为:2.6.32-431.el6.x86_64 升级后的内核版本为:3.10.101-1.el6.elrepo.x86_64 升级方法: 1.导入key rpm --import ht ...
- centos升级python到2.7
最近在阿里云租了一个云主机,打算部署自己的个人网站,但是centos系统的默认Python是2.6版本,打算升级到2.7.3! 查看python的版本 #python -V Python 2.6.6 ...
- Centos升级Python及pip
因为CentOS系统中旧版本的Python已被深度依赖,所以不能卸载原有的Python,只能全新安装. 1.从官网下载: wget https://www.python.org/ftp/python/ ...
- centos升级python(从2.6.6升级到2.7.8)
***先安装readline,否则升级后python回退和方向键不能使用 yum install readline-devel.x86_64 1.#wget www.python.org/ftp/ ...
- centos 升级python
1.下载python3.6.1的包 wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz 2.解压 tar -zxvf Pytho ...
随机推荐
- cognos 10.2.2 report studio数字---字符型查询注意事项
做了一个简单的报表,就是按照员工编号查询员工,其中员工编号是全数字,我们保存在数据库中的是字符型varchar2(10),所以在report studio中做查询就一直报告服务器错误. 其中使用cas ...
- asp:DateDiff 函数
DateDiff 函数 返回 Variant (Long) 的值,表示两个指定日期间的时间间隔数目. 语法 DateDiff(interval, date1, date2[, firstdayofwe ...
- window redis 安装配置
1 下载 https://github.com/MSOpenTech/redis/releases 当前最新版本为 redis-2.8.21 下载的为zip包,下载连接为:https://gith ...
- Hack--兼容性测试
CSS hack由于不同的浏览器,比如Internet Explorer 6,Internet Explorer 7,Mozilla Firefox等,对CSS的解析认识不一样,因此会导致生成的页面效 ...
- github 查看单个文件的历史记录命令
gitk 安装: apt-get install gitk 点击打开链接http://stackoverflow.com/questions/278192/view-the-change-histor ...
- 基于ActiveMQ的点对点收发消息
ActiveMQ是apache的一个开源消息引擎.可以作为即通引擎或者消息中间件引擎. 准备 下载ActiveMQ http://activemq.apache.org/download.html 进 ...
- notepad++ :正则表达式系统教程
前言&索引 前言 正则表达式是烦琐的,但是强大的,学会之后的应用会让你除了提高效率外,会给你带来绝对的成就感.只要认真去阅读这些资料,加上应用的时候进行一定的参考,掌握正则表达式不是问题. 索 ...
- 如何使用KMS激活win10和office
首先你需要下载一个kms软件,地址: https://yunpan.cn/cRxVNy2LRXjBt (提取码:d5d8) 然后搭建kms服务器,很简单.启动软件,选择“附加”Tab, 点连接到服务器 ...
- js+jquery检测用户浏览器型号(包括对360浏览器的检测)
做网站,js检测用户浏览器的版本,是经常要使用到,今天自己写了一个js,完成了对于一些常见浏览器的检测,但是,偏偏对于360浏览器的检测没有任 何办法,研究了一会儿,无果.无论是360安全浏览器,还是 ...
- QTcpsocket 实现FTP
http://blog.163.com/modingfa_002/blog/static/1109254662013111510358109/ http://baike.baidu.com/link? ...