`apt` 不会删除自动安装的依赖项

`apt` 不会删除自动安装的依赖项

系统:Ubuntu 18.04

apt卸载后不会删除jackd的依赖项jackd2(及其自身的依赖项)jackd

$ sudo apt install jackd
The following additional packages will be installed:
  jackd2 jackd2-firewire libconfig++9v5 libffado2 libglibmm-2.4-1v5 libsigc++-2.0-0v5 libxml++2.6-2v5 python-dbus python-gi qjackctl

$ sudo apt remove jackd
The following packages will be REMOVED:
  jackd qjackctl

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

$ sudo apt remove jackd2
The following packages were automatically installed and are no longer required:
  libconfig++9v5 libffado2 libglibmm-2.4-1v5 libsigc++-2.0-0v5 libxml++2.6-2v5 python-dbus python-gi
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  jackd2 jackd2-firewire
$ sudo apt autoremove 
The following packages will be REMOVED:
  libconfig++9v5 libffado2 libglibmm-2.4-1v5 libsigc++-2.0-0v5 libxml++2.6-2v5 python-dbus python-gi
0 upgraded, 0 newly installed, 7 to remove and 15 not upgraded.

答案1

您的系统上可能安装了另一个推荐或建议jackd2.你可以用aptitude why jackd2它来找出答案。

就我而言,它是blender通过另一个依赖项的包:

$ aptitude why jackd2                                                                                      
i   blender          Depends  libjack-jackd2-0 (>= 1.9.10+20150825) | libjack-0.125
i A libjack-jackd2-0 Suggests jackd2 (= 1.9.12~dfsg-2+b1)                          

并且您的 apt 可能配置为将推荐和建议视为依赖项,其设置称为APT::Autoremove::RecommendsImportantAPT::Autoremove::SuggestsImportant

我建议保留第一个设置,但您可以安全地禁用建议设置(但它仍然可能会卸载您想要保留的一些软件包,在这种情况下取​​消将它们标记为自动安装)。

要禁用处理建议和依赖于自动删除的设置:

sudo apt-get autoremove -o APT::Autoremove::SuggestsImportant=0

相关内容