Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] apt-get purge aftger apt-get remove


On Wed, Oct 28, 2009 at 09:51:34PM +1100, Michael Chesterton wrote:
>On 28/10/2009, at 9:35 PM, Daniel Pittman wrote:
>>peter@xxxxxxxxxxxxxxxxxx writes:
>>
>>>I've done apt-get remove to get rid of some packages, but I should
>>>have done apt-get remove --purge.  How do I get rid of the config
>>>file droppings all over my system?
>>
>>   dpkg --list | grep ^rc
>>
>># sudo dpkg --purge $(dpkg --list | grep ^rc | awk '{print $2}')
>
>What a waste, piping grep to awk. I suppose you also eat kittens?
>
>sudo dpkg --purge $(dpkg --list | awk '/^rc/ {print $2}')

get rid of awk (too big on tiny machines):

dpkg -P $( dpkg -l | while read a; do if [[ $a =~ ^rc ]]; then a=${a//  / }; a=${a#* }; echo ${a%% *}; fi; done )