How to upgrade GCC, G ++ in Ubuntu

Source: Internet
Author: User

As we all know, GCC does not support "make Uninstall ". A recommended installation method is to install GCC in a path you specify. When you do not need a GCC version number, you only need to remove the corresponding version number.


If you already have an old version number in your system, the simplest method is:

1) join? Personal package archive in the repositories

2. repositoris)

3) upgrade procedure

sudo add-apt-repository ppa:ubuntu-toolchain-r/testsudo apt-get update
Join? New Ppa (peronal package archive) to System

Delete alternative

sudo update-alternatives --remove-all gcc sudo update-alternatives --remove-all g++
Then:

sudo apt-get install gcc-4.8sudo apt-get install g++-4.8
Install GCC and G ++ as alternatives

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20sudo update-alternatives --config gccsudo update-alternatives --config g++
Finally:

sudo apt-get updatesudo apt-get upgrade -ysudo apt-get dist-upgrade

Translator's note:

Trial upgrade Effect

Terminal input: gcc-V

Terminal input is as follows:

...

GCC version 4.8.1 (Ubuntu 4.8.1-2ubuntu1 ~ 10.04.1)


Address: http://askubuntu.com/questions/312620/how-do-i-install-gcc-4-8-1-on-ubuntu-13-04

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.