Thursday, February 7, 2019

purge residual config files via GUI or CLI

From Synaptic in Kubuntu 18.04, I clicked on the "Status" button and found three items listed under "Not installed (residual config)":


One way to get rid of those is to select each item and mark them for "Complete Removal", then click the "Apply" button. However, they can also be found and removed via the command line. To find them, I used the dpkg -l | grep ^rc command:

$ dpkg -l | grep ^rc
rc  linux-image-4.15.0-42-generic                   4.15.0-42.45                                amd64        Signed kernel image generic
rc  linux-modules-4.15.0-42-generic                 4.15.0-42.45                                amd64        Linux kernel extra modules for version 4.15.0 on 64 bit x86 SMP
rc  linux-modules-extra-4.15.0-42-generic           4.15.0-42.45                                amd64        Linux kernel extra modules for version 4.15.0 on 64 bit x86 SMP


See man dpkg and man dpkg-query for info about the -l (--list) option.

Then, I used apt purge and a little copy-and-paste magic:

$ sudo apt purge linux-image-4.15.0-42-generic linux-modules-4.15.0-42-generic linux-modules-extra-4.15.0-42-generic


No comments: