SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-10-02 00:15:09

MarioMaster100
#! CrunchBanger
Registered: 2011-04-02
Posts: 184

Easy cleaning of /var/cache/apt

Tired of removing programs and apt-get autoclean or apt-get autoremove doesn't wipe them all out?

dpkg --get-selections|grep deinstall

will show all the list of remaining .debs. That could be a long list of files to remove individually, so here's a script I got help with to do that all at once. Just enter this in your editor

#!/bin/bash
set -e

for i in $(dpkg --get-selections| grep deinstall | awk '{ print $1 }');
    do dpkg -P $i
    
done
exit 0

name it whatever you like and make it executable

chmod +x filename

and run it as sudo smile


Thank you everyone for being helpful and answering my questions.
Machinae Supremacy fan for life \m/_(^_^)_\m/

Offline

Be excellent to each other!

#2 2012-10-02 01:49:49

swftech
#! CrunchBanger
From: SW Florida
Registered: 2012-06-08
Posts: 102

Re: Easy cleaning of /var/cache/apt

Nice script, thanks. You could also run..

dpkg --get-selections | grep deinstall | sed 's/deinstall/\lpurge/' | dpkg --set-selections; dpkg -Pa

To "deinstall/purge" the deb files all at once.

Then run

dpkg --get-selections | grep deinstall | wc -l

To make sure they are all gone. You should get "0" if they are all purged.

Last edited by swftech (2012-10-02 01:54:43)


My son didn't understand the concept of a committed relationship, so I told him it's like making a girl your default browser.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo