rempkg - package remover
Posted: Wed Apr 15, 2015 9:36 am
It's a frontend for apt-get autoremove --purge using dialog
Careful, it bites. Remove the -y option if you want a safety net.
Careful, it bites. Remove the -y option if you want a safety net.
Code: Select all
#!/bin/bash
. /usr/share/doc/dialog/examples/setup-vars
. /usr/share/doc/dialog/examples/setup-tempfile
dpkg --get-selections | awk -F ' ' '{ print $1 }' > ~/.pkglist
ar=()
while read n s ; do
ar+=($n "$s" "\n")
done < ~/.pkglist
dialog --clear --backtitle "Remove Packages" --checklist "Select packages to remove" 26 45 30 "${ar[@]}" 2> $tempfile
retval=$?
case $retval in
$DIALOG_CANCEL)
rm ~/.pkglist &>/dev/null
reset
clear
exit 0;;
esac
sudo apt-get -y autoremove --purge `cat $tempfile`
rm ~/.pkglist &>/dev/null