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

Mark mhullrich at gmail.com
Fri Nov 19 02:06:31 UTC 2010


On Thu, Nov 18, 2010 at 5:59 PM, K. Frank <kfrank29.c at gmail.com> wrote:
>
> That (mostly) did the trick.
>
> 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)
>
> It never occurred to me to specify g++-4.5.  Is there some
> sort of hierarchical naming convention going on?
>
Let's see now, suppose we rephrase the question as:

A. What is the difference between package and package-newer?

> Second question:
>
> How can I get g++ to resolve to version 4.5?
>
> The command g++ is not known (although g++-4.5 is), e.g.,
>
>   $ g++ --version
>   The program 'g++' can be found in the following packages:
>    * g++
>    * pentium-builder
>   Try: sudo apt-get install <selected package>
>
> while
>
>   $ g++-4.5 --version
>   g++-4.5 (Ubuntu/Linaro 4.5.1-7ubuntu2) 4.5.1 ...
>

As above, suppose the question were this:

B. How can I get package to resolve to package-newer?

> 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?
>

I suspect that this question is basically irrelevant, but it lies
along the same lines.

The answer to question A is, you can't because they are not the same package.

The answer to question B is, you can't because they are not the same package.

The answer to your last question is that g++-4.5 is packaged up in the
general gcc 4.5.1-7 package, not 4.5.1-10; i.e., they are not the same
package.

Hope that helps.




More information about the ubuntu-users mailing list