当我尝试删除 g++ 时,为什么 apt-get 尝试安装它?

irr*_*ohn 5 apt g++ 12.04

注意:最初我有很长的背景解释导致我尝试执行apt-get remove g++. 在 11.10(32 位)的全新安装中尝试此操作后,我已将其删除为无关紧要,然后在升级后,在 12.04 中。

看来只有12.04才有问题。是时候改变焦点了,看看这是否是一个报告的错误。


我没有找到任何看起来相关的东西,所以我将其报告为Bug #982716


在试图解决编译 Octave 的问题时,我删除了编译 Octave 所需的所有软件包,以便我可以重新安装它们。在执行此操作时,我遇到了apt-get12.04 中的意外响应。

当我尝试删除g++软件包时,apt-get 会尝试安装g++-4.6. 我希望得到消息Package g++ is not installed, so not removed。为什么我没有?

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])
Run Code Online (Sandbox Code Playgroud)

更新

--no-install-recommends选项指定为 的结果apt-get。令人惊讶的是(对我来说)似乎以同样的方式失败。还将(最终)更新错误报告。(为什么不?)

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
Run Code Online (Sandbox Code Playgroud)

irr*_*ohn 1

从Bug #982716的更新:

This bug was fixed in the package apt - 0.8.16~exp12ubuntu10
Run Code Online (Sandbox Code Playgroud)

(我从来没有抽出时间附上还包括 的结果--no-install-recommends。哦,好吧。)