summarylogtreecommitdiffstats
path: root/orphan-manager
blob: c08e64951062a4dea558543bd5572f503e2f22a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

# Cleans up orphaned packages on an Arch Linux system

if [[ $EUID -ne 0 ]]; then
        echo "You must be root to run this program"
        exit
fi

ORPHANS=$(pacman -Qdtq)
if [[ -z $ORPHANS ]]; then
        echo "No orphans present. Stopping."
else
        pacman -Rns --noconfirm $ORPHANS
fi