Skip to content

Instantly share code, notes, and snippets.

@mtgrosser
Last active August 29, 2015 14:11
Show Gist options
  • Save mtgrosser/475bdc4a370de478164e to your computer and use it in GitHub Desktop.
Save mtgrosser/475bdc4a370de478164e to your computer and use it in GitHub Desktop.
YUM-like commands for pacman
#!/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" "$@"
@mtgrosser
Copy link
Author

Copy to /usr/local/bin and chmod +x
Then you can type:

pac update

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