Created
December 17, 2013 14:59
-
-
Save meeuw/8006207 to your computer and use it in GitHub Desktop.
Use this script to find all "leaves" you've installed on your yum/rpm system. Add these "leaves" to PACKAGES="" and remove what you aren't using anymore. Then re-run the script until all unwanted packages are removed.
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
#!/bin/bash | |
PACKAGES="" | |
LEAVES="$(package-cleanup --leaves --all --qf='%{NAME}')" | |
ERASE=$(grep -vxf <(echo "$PACKAGES") <(echo "$LEAVES")) | |
if [ "$ERASE" ]; then | |
yum erase $ERASE | |
else | |
diff -udr <(echo "$LEAVES") <(echo "$PACKAGES") | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment