Skip to content

Instantly share code, notes, and snippets.

@suchipi

suchipi/pkg.sh

Last active Jan 30, 2019
Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@suchipi 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