1

I've gone from a single server to multi server setup in the past few weeks. I am now ready to uninstall Let's Encrypt / Certbot from the original server. (I've setup SSL termination with HA Proxy.)

I've tried apt remove --purge letsencrypt. But this is showing packages I am still requiring:

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]

I am at the tail end of PHP7.3 with just 1 script remaining using it. I am not fluent in Python. Would someone please explain the logic that has determined the list of packages the computer doesn't see as being required any more?

0
2

apt keeps track, for each package, whether it was installed because it was explicitly requested or because it was automatically pulled in as a dependency. Packages which are automatically installed become candidates for auto-removal when all the packages which need them are themselves removed.

Determining why packages become auto-removable in a specific context requires knowing the history of the system; there isn’t enough information here to say.

However, there’s no cause for alarm: apt is telling you that these packages are candidates for auto-removal, not that it is going to remove them. The packages will only be removed if you ask apt to remove them (apt autoremove for example). As it is, if you confirm the command in your question, only letsencrypt will be removed.

You can avoid this in future by marking them as manually installed, for example with

sudo apt-mark manual bsdmainutils

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.