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

K. Frank kfrank29.c at
Fri Nov 19 03:14:11 UTC 2010

Hello NoOp -

On Thu, Nov 18, 2010 at 10:00 PM, NoOp <glgxg at> wrote:
> On 11/18/2010 05:59 PM, K. Frank wrote:
>> Hello NoOp -
> ...
>> My first question:
>> What is the difference between:
>>    sudo apt-get install g++-4.5  (which seems to work)
>> and
>>    sudo apt-get install g++  (which installed 4.4)
> To be honest, I don't actually know. I _think that g++ (4.4) is the
> default. g++-4.5 is the dev version as best I can tell.
> ...
>> Second question:
>> How can I get g++ to resolve to version 4.5?
> Don't know that either. In the interim you can:
> $ g++-4.5 <filename>
> and that will work if you specify a file. I'm pretty sure that someone
> with better cli knowledge will come along shortly and advise how to set
> a link/dpkg --config et al to have g++ default to g++-4.5. Perhaps you
> can do it in the same manner as you set your java etc., to a particular
> version. But I really do now know the answer - sorry. I only looked into
> how to install due to your OP.

Thanks.  Yes, I know how to set a link, but I am hoping someone
can tell me the approved way to do so that will be consistent with
what ubuntu and/or the package managers are expecting.

> ...
>> Third question:
>> Not that I care, but suppose I had wanted to install
>> 4.5.1-10ubuntu1 (as I tried to do with dpkg)?  Why
>> did "apt-get install g++-4.5" resolve to 4.5.1-7?  Is
>> 4.5.1-10 not compatible with ubuntu 10.10?
> When you install a .deb file directly it will not pull in the
> dependencies. dpkg is a simple package installer. IOW; if you:
> $ sudo dpkg -i <somepackage>
> dpkg won't go out and get the package & dependencies, it will only do
> exactly as you instructed it to do: install the .deb. See:
> $ man dpkg
> and
> $ man apt-get
> to see the differences.

I have gone over the dpkg and apt-get man pages a few times
now.  I can't say, however, that I am feeling fully enlightened...

I appreciate your help.

K. Frank

More information about the ubuntu-users mailing list