Pacman alias function
pkg() { | |
case "$1" in | |
list) | |
# List all installed packages | |
command pacman -Q | |
;; | |
list-roots) | |
# List all installed packages that aren't required by anything | |
command pacman -Qet | |
;; | |
info) | |
# List info about an installed packge | |
command pacman -Qi "${@:2}" | |
;; | |
add) | |
command pacman -U "${@:2}" | |
;; | |
search) | |
# Search repo for a package | |
command pacman -Ss "${@:2}" | |
;; | |
install) | |
# Install a package from the repo | |
command pacman -S "${@:2}" | |
;; | |
upgrade) | |
# System-wide upgrade | |
command pacman -Syu | |
;; | |
delete) | |
# Remove a package | |
command pacman -R "${@:2}" | |
;; | |
remove) | |
# Remove a package | |
command pacman -R "${@:2}" | |
;; | |
autoremove) | |
# Remove all packages which are not required (leaves) | |
command pacman -R $(pacman -Qdtq) | |
;; | |
which) | |
# Show which package provides a file | |
command pacman -Qo "${@:2}" | |
;; | |
create) | |
command makepkg -s --asroot | |
;; | |
clean) | |
# Remove local copy of the package database | |
command pacman -Sc | |
;; | |
update) | |
# Update the package database | |
command pacman -Sy | |
;; | |
forceupdate) | |
# Force-update the package database | |
command pacman -Syy | |
;; | |
*) | |
echo "Valid arguments are list, list-roots, info, search, add, install, upgrade, delete, remove, autoremove, which, create, clean, update, forceupdate" | |
esac | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Why the hell does GitHub print tabs as 8 spaces