Last active
January 30, 2019 16:10
-
-
Save suchipi/5ad9eaca682e1f255d575d6c86215d05 to your computer and use it in GitHub Desktop.
Pacman alias function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Why the hell does GitHub print tabs as 8 spaces