zoukankan      html  css  js  c++  java
  • 把ubuntu自带的高gcc版本降到低版本(如gcc 3.4)的方法

    转载自:
    博客1博客2博客3

    步骤

    第一步:

    下载所需gcc安装包(.deb格式)

     手动:老版本gcc下载地址:http://old-releases.ubuntu.com/ubuntu/pool/universe/g/ ; http://archive.ubuntu.com/ubuntu/pool/universe/g/
    
     自动:wget http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-版本号/版本号.deb
    
     备注:使用wget自动下载时,可能出现中断,需要重新下载。重新下载时,下载的文件命名时会自动追加(1)。使得,dpkg时找不到重新下载的文件。需要手动更改文件名。
    

    第二步:

    dpkg下载的安装包。

    第三步:

    dpkg后,如果没有显示降级,可以手动设置优先级,如下:

    $sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 40 (这里“40”是优先级,值越大优先级越高)

    $sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 (本机自带的设置为60更高的优先级)

    举例

    以gcc3.4为例依次执行如下命令即可(下载安装前面5个即可):

    wget http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/gcc-3.4-base_3.4.6-6ubuntu3_amd64.deb
    
    sudo dpkg --force-depends -i gcc-3.4-base_3.4.6-6ubuntu3_amd64.deb
    
    
    
    wget http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/gcc-3.4_3.4.6-6ubuntu3_amd64.deb
    
    sudo dpkg --force-depends -i gcc-3.4_3.4.6-6ubuntu3_amd64.deb 
    
    
    wget http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/cpp-3.4_3.4.6-6ubuntu3_amd64.deb
    
    sudo dpkg --force-depends -i cpp-3.4_3.4.6-6ubuntu3_amd64.deb 
    
    
    
    wget http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/g++-3.4_3.4.6-6ubuntu3_amd64.deb
    
    sudo dpkg --force-depends -i g++-3.4_3.4.6-6ubuntu3_amd64.deb
    
    
    wget http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/libstdc++6-dev_3.4.6-6ubuntu3_amd64.deb
    
    sudo dpkg --force-depends -i libstdc++6-dev_3.4.6-6ubuntu3_amd64.deb
    
    
    wget http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/g77-3.4_3.4.6-6ubuntu3_amd64.deb
    
    sudo dpkg --force-depends -i g77-3.4_3.4.6-6ubuntu3_amd64.deb
    
    
    wget http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/libg2c0-dev_3.4.6-6ubuntu3_amd64.deb
    
    sudo dpkg --force-depends -i libg2c0-dev_3.4.6-6ubuntu3_amd64.deb
    
    sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-3.4 30
    
    
  • 相关阅读:
    Python 爬取网易云歌手的50首热门作品
    对于AES和RSA的个人理解
    sqlzoo
    项目部署 uwsgi+nginx+crm
    nginx学习
    redis补充知识--- 缓存击穿、缓存雪崩、缓存穿透
    redis-cluster 搭建
    redis主从复制
    redis-sentinel (哨兵)
    redis 发布订阅
  • 原文地址:https://www.cnblogs.com/Pan-xi-yi/p/12044608.html
Copyright © 2011-2022 走看看