[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Get to the bottom of what is running my networks



keitho@strucktower.com wrote:
> > You can check which packages are uninstalled but still have their
> > config hanging around with "aptitude search '?config-files'".
> >
> > You can then run "apt-get purge <package>" to get rid of the config
> > one particular package or "apt-get purge $(aptitude search
> > '?config-files' -F '%p" to get rid of all the leftover configs.
> 
> Thanks for posting this gem!
> 
> However, I could be wrong, but I think there is a typo. Might just be how
> my web translation came across. The last command should be:
> 
> $sudo apt-get purge $(aptitude search '?config-files' -F %p)
> 
> No tick in front of the %p and a close-parenthesis at the end. One might
> also use the --dry-run option first as well just in case...

I always use dpkg -l to get the list and then purge those.  Using dpkg
directly is soooo much faster that way.

  dpkg -l | awk '/^rc/{print$2}'

And if that list looks reasonable then purge it.

  dpkg --purge $(dpkg -l | awk '/^rc/{print$2}')

There are fancier ways to do it using fancier tools that are perhaps
more precise and accurate instruments.  Here is my favorite to get the
same list as the above.

  grep-status -sPackage -n -FStatus "deinstall ok config-files"

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: