Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I tried downoading 4.8 for 12.04 from https://launchpad.net/~ubuntu-toolchain-r/+archive/test/+packages (I did not find for 13.04 as is mentioned here: How to install gcc-4.8 in Ubuntu 12.04 from the terminal) and I think I messed up trying to install it.

apt-get install gcc-4.8 gives :

The following packages have unmet dependencies:

followed by a long list of packages and the recommendation:

E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution) 

but apt-get -f install says

E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

Please help I need it for the C++11 support

Update 04/28/2013

This was fixed with

sudo apt-get clean

followed by

sudo apt-get update 

then

apt-get upgrade -f 

Many thanks to everyone for trying to help!

share|improve this question
    
You can add this as an answer to show that it is solved. Thanks. –  belacq May 3 '13 at 15:35

3 Answers 3

The best way to install gcc with C++11 support is to do

sudo apt-get install build-essential

and then compile the source code with

g++ <Filename>.cpp -std=c++0x
share|improve this answer
    
but you still need to add ppa otherwise it will install 4.7 –  Qasim Apr 27 '13 at 5:37
    
Even with 4.7 we can compile C++11. –  thefourtheye Apr 27 '13 at 5:40
    
ty for updating ....i dont know anything about C++11 –  Qasim Apr 27 '13 at 5:41
    
You are welcome :) –  thefourtheye Apr 27 '13 at 5:42
    
thanks for answering! –  user152730 Apr 27 '13 at 21:10

You can install gcc 4.8 in Ubuntu 13.04, just follow the commands

 sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
 sudo apt-get update
 sudo apt-get install gcc-4.8-base

Source How to install gcc-4.8 in Ubuntu 12.04 from the terminal

enter image description here

share|improve this answer
    
thanks for answering! Please read my comment to the above answer I am getting the same errors when I try apt-get update, mea culpa! Package Manager was open now I get: sudo apt-get install gcc-4.8-base Reading package lists... Done Building dependency tree Reading state information... Done gcc-4.8-base is already the newest version. You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: <list of packages follows> and finally E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). –  user152730 Apr 27 '13 at 21:18
    
... as with apt-get install build-essential above –  user152730 Apr 27 '13 at 21:24

install two debian packages...(you can search Google to download and install it)

64-bit

libisl10_0.11.1-2_amd64.deb

libcloog-isl4_0.18.0-2_amd64.deb

command: sudo dpkg -i 'package_name'

sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y

sudo apt-get update

sudo apt-get install g++-4.8 gcc-4.8

share|improve this answer
    
thanks for answering! please read my comments to the above answers –  user152730 Apr 27 '13 at 21:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.