How do I install g++ 4.5 on ubuntu 10.10?

K. Frank kfrank29.c at gmail.com
Thu Nov 18 23:46:19 UTC 2010


Hello All -

I'm still monkeying around, trying to get g++ 4.5 installed,
with still no success, and I still have questions...

On Tue, Nov 16, 2010 at 9:48 PM, K. Frank <kfrank29.c at gmail.com> wrote:
> Hi NoOp -
>
> On Tue, Nov 16, 2010 at 8:31 PM, NoOp <glgxg at sbcglobal.net> wrote:
>> On 11/16/2010 03:40 PM, K. Frank wrote:
>>> Hello All -
>>>
>>> I am playing around with a newly installed ubuntu 10.10, and would
>>> like to install g++ 4.5.  Could anyone tell me how to do this?
>>>
>>> It appears that ubuntu came with gcc 4.4 already installed, but not
>>> g++.  Running "apt-get install g++" installs g++, but its version 4.4
>>> (as I guess I would expect).
>>>
>>> I've found what appear to be g++ 4.5 binaries, e.g.:
>>>
>>>    https://launchpad.net/ubuntu/natty/i386/gcc-4.5/4.5.1-10ubuntu1
>>>    https://launchpad.net/ubuntu/natty/i386/g++-4.5/4.5.1-10ubuntu1
>> ...
>
>> Not sure. But perhaps you can get the associated depends as well:
>
> I don't, in concrete terms, know how to do this.
>
>> http://packages.ubuntu.com/natty/g++
>
> I had already happened across the above web page.  It seemed
> to lead me to, among other places, the links to the ".deb" files
> I mentioned above.  Other than those links, I don't know how
> to use the link you gave to "get the associated" dependencies.
> ...

Is there a simple way to install g++ 4.5?

Okay, my latest attempts:

Based on the fact that the seemingly relevant packages are
".deb" files, I have been playing around with dpkg and dpkg-deb.
Using dpkg-deb to look inside of gcc-4.5_4.5.1-10ubuntu1_i386.deb,
it does appear to be a gcc 4.5 installation.

So I tried to use dpkg to install gcc-4.5_4.5.1-10ubuntu1_i386.deb,
and it complained about incompatible dependencies, specifically
referring to stuff labelled 4.5.1-7ubuntu.  So I then tried using
dpkg to install gcc-4.5_4.5.1-7ubuntu2_i386.deb.  This it let me
do, at least partially, but I couldn't run gcc.  (It may have complained
about missing dependencies -- I don't remember precisely.)

At some point -- I think after a suspend/resume -- I noticed a
message icon from Synaptic Package Manager (not Ubuntu
Software Center) complaining about a broken package.
Synaptic claimed to fix it for me.

However, I still can't run gcc (at least not normally):

$ gcc --version
The program 'gcc' can be found in the following packages:
 * gcc
 * pentium-builder
Try: sudo apt-get install <selected package>

However, poking around I find /usr/bin/gcc-4.5 (as well
as /usr/bin/gcc-4.4).  It appears to run:

$ /usr/bin/gcc-4.5 --version
gcc-4.5 (Ubuntu/Linaro 4.5.1-7ubuntu2) 4.5.1
Copyright (C) 2010 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.

Well, as you can see, things are still a muddle.  How do I get
g++ 4.5 fully and properly installed?

And more to the point:  What's actually going on here?

Among many other issues, it seems that apt-get, dpkg,
Synaptic Package Manager, and Ubuntu Software Center
are not on the same page concerning what's installed or
not or is broken, or what versions are available, or what
the various dependencies are.

(Surely using dpkg to partially install a .deb file, and then
waiting for a Synaptic Package Manager error icon to give
me the opportunity to "Fix Broken Package" is not the
approved package installation procedure.)

Thanks for any help getting this sorted out.

Again, the short question is how do I install g++ 4.5, but
I would also like to understand some of what's going on
under the hood.


K. Frank




More information about the ubuntu-users mailing list