Skip to content

Instantly share code, notes, and snippets.

@suchipi
Last active January 30, 2019 16:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suchipi/5ad9eaca682e1f255d575d6c86215d05 to your computer and use it in GitHub Desktop.
Save suchipi/5ad9eaca682e1f255d575d6c86215d05 to your computer and use it in GitHub Desktop.
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
}
@suchipi
Copy link
Author

suchipi commented Dec 16, 2018

Why the hell does GitHub print tabs as 8 spaces

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment