-
-
Save mtgrosser/475bdc4a370de478164e to your computer and use it in GitHub Desktop.
YUM-like commands for pacman
This file contains hidden or 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
#!/bin/bash | |
usage() | |
{ | |
echo "USAGE: pac (search|install|update|upgrade|list|listpkg|remove|foreign|whatprovides) [packagename]" | |
} | |
PACMAN=/usr/bin/pacman | |
CMD=$1 | |
shift | |
case "$CMD" in | |
help) | |
usage && exit 0 | |
;; | |
search) | |
OPTS="-Ss" | |
;; | |
install) | |
OPTS="-S" | |
;; | |
upgrade) | |
OPTS="-U" | |
;; | |
remove) | |
OPTS="-Rc" | |
;; | |
update) | |
OPTS="-Syu" | |
;; | |
list) | |
OPTS="-Ql" | |
;; | |
listpkg) | |
OPTS="-Qpl" | |
;; | |
foreign) | |
OPTS="-Qm" | |
;; | |
whatprovides) | |
OPTS="-Qo" | |
;; | |
*) | |
usage && exit 1 | |
;; | |
esac | |
exec "$PACMAN" "$OPTS" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Copy to /usr/local/bin and chmod +x
Then you can type:
pac update