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.

Note: Originally I had a long background explanation leading up to why I was trying to perform apt-get remove g++. I have deleted that as irrelevant after trying this in a clean install of 11.10 (32-bit) and then, after upgrading, in 12.04.

It appears to be a problem only 12.04. Time to change focus and see if this is a reported bug.


I did not find anything that looked related so I reported this as Bug #982716.


While attempting to get rid of a problem compiling Octave I removed all the packages needed to compile Octave so I could then re-install them. While doing this I ran into an unexpected response from apt-get in 12.04.

When I attempt to remove the g++ package, apt-get instead attempts to install g++-4.6. I expected to get the message Package g++ is not installed, so not removed. Why didn't I?

me@BlueUbuntu64:~$ sudo apt-get -V --dry-run remove g++
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
   g++-4.6 (4.6.3-1ubuntu4)
   libstdc++6-4.6-dev (4.6.3-1ubuntu4)
Suggested packages:
   g++-multilib (4.6.3-1ubuntu5)
   g++-4.6-multilib (4.6.3-1ubuntu4)
   gcc-4.6-doc (4.6.3-1ubuntu4)
   libstdc++6-4.6-dbg (4.6.3-1ubuntu4)
   libstdc++6-4.6-doc (4.6.3-1ubuntu4)
The following NEW packages will be installed:
   g++ (4.6.3-1ubuntu5)
   g++-4.6 (4.6.3-1ubuntu4)
   libstdc++6-4.6-dev (4.6.3-1ubuntu4)
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Inst libstdc++6-4.6-dev (4.6.3-1ubuntu4 Ubuntu:12.04/precise [amd64]) []
Inst g++-4.6 (4.6.3-1ubuntu4 Ubuntu:12.04/precise [amd64])
Inst g++ (4:4.6.3-1ubuntu5 Ubuntu:12.04/precise [amd64])
Conf libstdc++6-4.6-dev (4.6.3-1ubuntu4 Ubuntu:12.04/precise [amd64])
Conf g++-4.6 (4.6.3-1ubuntu4 Ubuntu:12.04/precise [amd64])
Conf g++ (4:4.6.3-1ubuntu5 Ubuntu:12.04/precise [amd64])

Update

Result of specifying --no-install-recommends option to apt-get. Surprisingly (to me) seems to fail the same way. Will also (eventually) update the bug report. (Why not?)

me@Vbubux86-11:~$ sudo apt-get -V --dry-run --no-install-recommends remove g++
[sudo] password for me: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
   g++-4.6 (4.6.3-1ubuntu4)
   libstdc++6-4.6-dev (4.6.3-1ubuntu4)
Suggested packages:
   g++-multilib (4.6.3-1ubuntu5)
   g++-4.6-multilib (4.6.3-1ubuntu4)
   gcc-4.6-doc (4.6.3-1ubuntu4)
   libstdc++6-4.6-dbg (4.6.3-1ubuntu4)
   libstdc++6-4.6-doc (4.6.3-1ubuntu4)
The following NEW packages will be installed:
   g++ (4.6.3-1ubuntu5)
   g++-4.6 (4.6.3-1ubuntu4)
   libstdc++6-4.6-dev (4.6.3-1ubuntu4)
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Inst libstdc++6-4.6-dev (4.6.3-1ubuntu4 Ubuntu:12.04/precise [i386]) []
Inst g++-4.6 (4.6.3-1ubuntu4 Ubuntu:12.04/precise [i386])
Inst g++ (4:4.6.3-1ubuntu5 Ubuntu:12.04/precise [i386])
Conf libstdc++6-4.6-dev (4.6.3-1ubuntu4 Ubuntu:12.04/precise [i386])
Conf g++-4.6 (4.6.3-1ubuntu4 Ubuntu:12.04/precise [i386])
Conf g++ (4:4.6.3-1ubuntu5 Ubuntu:12.04/precise [i386])
me@Vbubux86-11:~$ apt-cache policy g++
g++:
  Installed: (none)
  Candidate: 4:4.6.3-1ubuntu5
  Version table:
     4:4.6.3-1ubuntu5 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise/main i386 Packages
share|improve this question
    
The only thing I can think of is that it might be part of one of those standard desktop program lists. Every desktop has, for example, a simple text editor. Some use gedit, but there are many replacements. Maybe g++ is one of those, and so apt is selecting another package that provides that feature and it just happens to be a different version of g++ –  Huckle Apr 16 '12 at 3:17
    
Given that this was know confirmed as a bug, this question is now considered as relevant only to as specific moment in time and hence has been closed as too-localised. Thanks. –  fossfreedom Apr 21 '12 at 20:49
    
@irrationalJohn Bug tag is a meta tag. It has no use on this site. –  jrg Jun 13 '12 at 16:46
    
@jrg Oh. So the bug should be deleted from this site then, no? Or are you saying that there is one common set of tags which is shared by both the main and the meta sites of Ask Ubuntu? –  irrational John Jun 13 '12 at 16:47
    
@irrationalJohn It is a 'meta' tag in that it has no useful meaning - if it really is a bug, then it shouldn't be posted here to begin with! So the tag is more or less useless. –  jrg Jun 13 '12 at 18:16
add comment

closed as too localized by fossfreedom Apr 21 '12 at 20:47

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

up vote 0 down vote accepted

From an update to Bug #982716:

This bug was fixed in the package apt - 0.8.16~exp12ubuntu10

(I never did get around to attaching the result of also including --no-install-recommends. Oh, well.)

share|improve this answer
add comment

Try doing this:

sudo apt-get -V --dry-run --no-install-recommends remove g++
share|improve this answer
add comment

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