-
-
Save ryo1kato/3792264 to your computer and use it in GitHub Desktop.
short-cut wrapper for apt-get and apt-cache
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 | |
# a lazy guy's wrapper for apt commands | |
case $1 in | |
showpkg|showsrc|stats|search|show|depends|rdepends|pkgnames) | |
set -x | |
apt-cache "$@" | |
;; | |
# short-cuts | |
se|srch) shift; set -x; apt-cache search "$@";; | |
dep) shift; set -x; apt-cache depends "$@";; | |
rdep) shift; set -x; apt-cache rdepends "$@";; | |
update|upgrade|install|remove|source|check|autoclean|autoremove|uninstall) | |
set -x | |
sudo apt-get "$@" | |
;; | |
get|cache) | |
aptcmd="apt-$1" | |
shift | |
$aptcmd "$@" | |
;; | |
''|-h|--help) | |
echo "Usage: apt {Commands for apt-get or apt-cache}" | |
;; | |
*) | |
echo "ERROR: unsupported apt-(get|cache) command for this wrapper: $1" | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment