#!/bin/bash # Remove all the named packages from the system if they're installed (otherwise ignore). for pkg in "$@"; do if pacman -Q "$pkg" &>/dev/null; then sudo pacman -Rns --noconfirm "$pkg" fi done