Purge residual config packages on Debian and Ubuntu

Jun 21, 2025

This article follows this post.

I upgraded my Linux system today, from Lubuntu 22.04 to Lubuntu 24.04. So far, the upgrade was smooth, I haven't encountered any errors. Except when upgrading version, they replaced many apps with the new version's equivalents. So many old apps were uninstalled and stuck at [residual-config]. So a way to solve this is through apt-get tool from Ubuntu and Debian.

To list packages that have been removed but still have configuration files left behind:

apt list '~c'

To remove the configuration files for packages that are no longer installed:

apt purge '~c'