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