Ubuntu: How do I install gcc 4.7? (2 Solutions!)

preview_player
Показать описание
Ubuntu: How do I install gcc 4.7?

The Question: I wish to install gcc 4.7 so that I can use some c++11 features.
I downloaded the source, ran ./configure and was told I needed GMP. Downloaded
the code for that, hit ./configure and was told I needed m4. But I already have
m4 (least that is what synamptic tells me).
What is going on and how can I fix it?

Solutions Sample (Please watch the whole video to see all solutions, in order of how many people found them helpful):

== This solution helped 61 people ==
installing gcc 4.7. Do note that it has packages only for 12.04 and not for
11.10.
Run the following commands in a terminal:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.7
Or, if you prefer a graphical way of installing a PPA, take a look at https://

Рекомендации по теме