Last active
January 21, 2018 19:03
-
-
Save Myl0g/c99ff17721ac75d7456cac329779e538 to your computer and use it in GitHub Desktop.
Audit and remove the packages on an Arch system (yaourt needed)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
set -e | |
blue=$(tput setaf 4) | |
normal=$(tput sgr0) | |
yaourt -Qqe > packages.txt | |
cp packages.txt wanted.txt | |
echo "Delete the packages from the list in order to mark them for removal..." | |
sleep 4 | |
vim wanted.txt | |
comm -23 <(sort packages.txt) <(sort wanted.txt) > to_delete.txt | |
cat to_delete.txt | |
printf "${blue}Really delete these packages? Y or N.${normal} " | |
read USER_CONT | |
if [ "$USER_CONT" == "y" ] || [ "$USER_CONT" == "Y" ] | |
then | |
yaourt -Rsn - < to_delete.txt | |
fi | |
rm packages.txt wanted.txt to_delete.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment