soscmd/soscmd-prune-pacman

11 lines
310 B
Text
Raw Permalink Normal View History

2023-06-03 11:28:50 +02:00
#!/bin/bash
if [ ! -f "/usr/bin/pacman-key" ]; then
echo ":: Error: You are not running a Arch Linux based distro."
exit 1
fi
if [ "$(pacman -Qdtq)" == "" ]; then
echo ":: Error: No unused packages or dependencies can be uninstalled with pacman."
exit 2
fi
pacman -R $(pacman -Qdtq) --recursive --unneeded