diff --git a/utils.sh b/utils.sh index b595aa9..ce42c8e 100755 --- a/utils.sh +++ b/utils.sh @@ -81,8 +81,10 @@ remove_packages() { local packages=("$@") local to_remove=() + # Match the exact name: pacman -Q also finds a package that provides it, such + # as herdr-bin for herdr, which pacman -R won't remove by that name for pkg in "${packages[@]}"; do - if is_installed "$pkg"; then + if [ "$(pacman -Qq "$pkg" 2> /dev/null)" = "$pkg" ]; then to_remove+=("$pkg") fi done