Sunday, March 22, 2020

Remove Configuration Files Left Over From "apt remove"

The following command will list the packages with leftover configuration files.
dpkg -l | grep ^rc

Hence, send the output to apt purge to remove all such packages.
apt purge `dpkg -l | grep ^rc |awk '{print $2}'|xargs`

In the future, to avoid having the configuration files leftover after removing a package, use
apt purge <PACKAGE>

No comments: