CentOS7更新各环境

本文章仅作为个人笔记

go语言
go官网
go1.10.1安装包下载链接
  • 安装可能用到的工具

      yum install wget -y
    
  • 获取go语言源包

      wget https://dl.google.com/go/go1.10.1.src.tar.gz
    
  • 解压到指定文件夹

      mkdir ~/opt
      tar zxvf go1.10.1.src.tar.gz -C ~/opt
    
  • 更新环境变量并使环境变量生效

      vim ~/.bash_profile 
        GOROOT_BOOTSTRAP=~/opt/go
        PATH=$PATH:$HOME/bin:$GOROOT_BOOTSTRAP/bin 
      source /etc/profile
    
python语言
python官网
python3.6.5安装包下载链接
  • 安装可能用到的工具

      yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make wget -y
    
  • 获取python3.6.5语言源包

      wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
    
  • 备份旧python,以防出问题后无法还原

      mv /usr/bin/python /usr/bin/python.bak
    
  • 解压安装配置

      tar -zxvf  Python-3.6.5.tgz
      cd Python-3.6.5
      ./configure prefix=/usr/local/python3
      make && make install
      ln -s /usr/local/python3/bin/python3 /usr/bin/python
      ln -s /usr/local/python3/bin/python3 /usr/bin/python3
    
  • 解决问题

    • 因为执行yum需要python2版本,所以我们还要修改yum的配置,执行:

        vi /usr/bin/yum
        把 #! /usr/bin/python修改为#! /usr/bin/python2
        同理 vi /bin/yum
        把 #! /usr/bin/python 也要修改为#! /usr/bin/python2
        同理 vi /usr/libexec/urlgrabber-ext-down
        把 #! /usr/bin/python 也要修改为#! /usr/bin/python2
      
sqlite
sqlite官网
sqlite3.24.0安装包下载链接
安装sqlite3.24.0
    wget http://www.sqlite.org/snapshot/sqlite-snapshot-201804241859.tar.gz
    tar -zxvf sqlite-snapshot-201804241859.tar.gz
    cd sqlite-snapshot-201804241859
    ./configure
    make
    make install
更新python内部sqlite
  • 想要更新python内部的sqlite首先安装新版的sqlite,然后更改环境变量加入 export LD_LIBRARY_PATH=,例如:

      export LD_LIBRARY_PATH=/root/sqlite-snapshot-201804241859/.libs
    

你可能感兴趣的:(CentOS7更新各环境)