ubuntu gcc 降级和升级

前端之家收集整理的这篇文章主要介绍了ubuntu gcc 降级和升级前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
方法基本一样:

先清除原来的版本:

sudo update-alternatives --remove-all gcc

sudo update-alternatives --remove-all g++


安装指定版本

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 48 \

--slave /usr/bin/g++ g++ /usr/bin/g++-4.8 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-4.8 \
--slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-4.8 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-4.8


配置更改:

sudo update-alternatives --config gcc
sudo update-alternatives --config g++


查看修改完的版本:

gcc --version

gcc (Ubuntu/Linaro X.X.X-1ubuntu1~14.04) X.X.X

Copyright (C) 20XX Free Software Foundation,Inc.

This is free software; see the source for copying conditions. There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


g++ --version

g++ (Ubuntu/Linaro X.X.X-1ubuntu1~14.04) X.X.X

Copyright (C) 20XX Free Software Foundation,Inc.

This is free software; see the source for copying conditions. There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

原文链接:https://www.f2er.com/ubuntu/353994.html

猜你在找的Ubuntu相关文章