apt-get autoremove 看不到已删除包的依赖项?

apt-get autoremove 看不到已删除包的依赖项?

我已经ubuntu-sdk安装了,/var/log/apt/history.log对此必须说一下:

Commandline: apt --no-install-recommends install ubuntu-sdk
Install: python3-simplejson:i386 (3.3.1-1ubuntu6, automatic), click-doc:i386 (0.4.43+16.04.20160203-0ubuntu3~0trusty1, automatic), libsybdb5:i386 (0.91-5, automatic), libjs-underscore:i386 (1.4.4-2ubuntu1, automatic), libxcb-xinerama0:i386 (1.10-2ubuntu1, automatic), libboost-program-options1.54.0:i386 (1.54.0-4ubuntu3.1, automatic), schroot-common:i386 (1.6.8-1ubuntu1.1, automatic), freetds-common:i386 (0.91-5, automatic), schroot:i386 (1.6.8-1ubuntu1.1, automatic), xserver-xephyr:i386 (1.15.1-0ubuntu2.7, automatic), ubuntu-sdk:i386 (1.126.2~0ubuntu1~trusty2), intltool:i386 (0.50.2-2, automatic), devscripts:i386 (2.14.1ubuntu0.1, automatic), dh-make:i386 (0.63, automatic), libpq5:i386 (9.3.12-0ubuntu0.14.04, automatic), mysql-common:i386 (5.5.49-0ubuntu0.14.04.1, automatic), gdb-multiarch:i386 (7.7.1-0ubuntu5~14.04.2, automatic), libmysqlclient18:i386 (5.5.49-0ubuntu0.14.04.1, automatic), click-reviewers-tools:i386 (0.35-0~550~ubuntu14.04.1, automatic), fcitx-libs:i386 (4.2.8.3-3, automatic), python3-magic:i386 (5.14-2ubuntu3.3, automatic), python3-yaml:i386 (3.10-4ubuntu0.1, automatic), libbotan-1.10-0:i386 (1.10.5-1ubuntu1, automatic), libjs-sphinxdoc:i386 (1.2.2+dfsg-1ubuntu1.1, automatic), click-dev:i386 (0.4.43+16.04.20160203-0ubuntu3~0trusty1, automatic), libxcb-xf86dri0:i386 (1.10-2ubuntu1, automatic), ubuntu-sdk-ide:i386 (3.5.1~133+201604191700~ubuntu14.04.1)

显然,已经安装了依赖项。因此,我首先删除了该ubuntu-sdk包:

$ sudo apt-get remove --purge ubuntu-sdk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  ubuntu-sdk*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 32.8 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 303883 files and directories currently installed.)
Removing ubuntu-sdk (1.126.2~0ubuntu1~trusty2) ...

好的,现在我尝试使用以下命令删除依赖项autoremove

$ sudo apt-get autoremove --purge
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

嗯。。什么?Apt-getautoremove应该已经识别出需要删除的依赖包了,但是它却没有识别?

为什么会发生这种情况?autoremove删除依赖包后我该如何ubuntu-sdk删除它?

答案1

好的,我想我最好检查一下这个包的依赖项:

$ apt-cache depends ubuntu-sdk
ubuntu-sdk
  Depends: ubuntu-sdk-ide

嗯...只有一个依赖项?让我们看看它说了什么:

$ apt-cache depends ubuntu-sdk-ide
ubuntu-sdk-ide
  Depends: android-tools-adb
  Depends: click
  Depends: click-dev
  Depends: click-doc
  Depends: click-apparmor
  Depends: cmake
  Depends: intltool
  Depends: python3
  Depends: devscripts
  Depends: dh-make
  Depends: rsync
  Depends: webapp-container
  Depends: gdb-multiarch
  Depends: click-reviewers-tools
  Depends: phablet-tools
...

好的,这更像是...在这一点上,ubuntu-sdk单独删除与 OP 中的相同,但是当我尝试删除ubuntu-sdk两者时ubuntu-sdk-ide

$ sudo apt-get remove --purge ubuntu-sdk ubuntu-sdk-ide
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  click-dev click-doc devscripts fcitx-libs freetds-common gdb-multiarch
  intltool libboost-program-options1.54.0 libbotan-1.10-0 libjs-sphinxdoc
  libjs-underscore libmysqlclient18 libpq5 libsybdb5 libxcb-xinerama0
  mysql-common schroot schroot-common
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  ubuntu-sdk* ubuntu-sdk-ide*
0 upgraded, 0 newly installed, 2 to remove and 1 not upgraded.
After this operation, 149 MB disk space will be freed.
Do you want to continue? [Y/n]

...这看起来确实是正确的(因为我之前已经手动安装了一些依赖项...)无论如何,希望就是这样......

相关内容