summaryrefslogtreecommitdiff
path: root/scripts/zypper_rm_unused.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/zypper_rm_unused.sh')
-rwxr-xr-xscripts/zypper_rm_unused.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/zypper_rm_unused.sh b/scripts/zypper_rm_unused.sh
new file mode 100755
index 0000000..98a0f2e
--- /dev/null
+++ b/scripts/zypper_rm_unused.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Copied from somewhere on the internet
+zypper packages --unneeded | awk -F'|' 'NR==0 || NR==1 || NR==2 || NR==3 || NR==4 {next} {print $3}' > list
+while read p; do zypper info $p && zypper se --requires $p && zypper rm $p; done < list
+rm -rf list