卸载显示意外的软件包

卸载显示意外的软件包

在过去的几周里,我已经从单服务器设置转向多服务器设置。我现在准备卸载让我们加密/证书机器人来自原始服务器。 (我有设置 SSL 终止高可用性代理.)

我试过了apt remove --purge letsencrypt。但这显示了我仍然需要的包:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  bsdmainutils cpp-8 dh-python libapache2-mod-php7.3 libasan5 libbind9-161 libbison-dev libboost-iostreams1.67.0 libboost-system1.67.0 libc-dev-bin libcwidget3v5 libdns1104 libdns1110 libevent-2.1-6 libf2fs-format4 libf2fs5 libgfortran5
  libicu63 libip6tc0 libiptc0 libirs161 libisc1100 libisc1105 libisccc161 libisccfg163 libisl19 liblinear3 libllvm7 liblua5.2-0 liblwres161 libmemcachedutil2 libmpdec2 libperl5.28 libprocps7 libpython3.7 libpython3.7-minimal
  libpython3.7-stdlib linux-libc-dev ncal perl-modules-5.28 php-symfony-debug php7.3 php7.3-bcmath php7.3-fpm php7.3-mysql php7.3-pgsql php7.3-soap php8.0-memcached python3-asn1crypto python3-future python3-mock python3-pbr python3.7
  python3.7-minimal usb.ids
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  letsencrypt*
0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded.
After this operation, 30.7 kB disk space will be freed.
Do you want to continue? [Y/n]

我处于 PHP7.3 的尾部,只剩下 1 个脚本在使用它。我对 Python 不太熟悉。有人可以解释一下确定计算机不再需要的软件包列表的逻辑吗?

答案1

apt跟踪每个包,无论它是因为明确请求而安装的,还是因为它作为依赖项自动引入的。当所有需要自动安装的软件包本身被删除时,自动安装的软件包将成为自动删除的候选者。

确定为什么软件包在特定上下文中变得可自动删除需要了解系统的历史记录;这里没有足够的信息可说。

然而,没有理由惊慌:apt告诉您这些软件包是自动删除的候选者,而不是它将删除它们。仅当您要求apt删除这些软件包时(apt autoremove例如),它们才会被删除。事实上,如果您确认问题中的命令,则只会letsencrypt被删除。

您将来可以通过以下方式避免这种情况将它们标记为手动安装,例如

sudo apt-mark manual bsdmainutils

相关内容