Skip to content

Instantly share code, notes, and snippets.

@JuanjoSalvador
Last active August 15, 2017 09:49
Show Gist options
  • Save JuanjoSalvador/9c711a6848dcadb51c97a4a9ec501a43 to your computer and use it in GitHub Desktop.
Save JuanjoSalvador/9c711a6848dcadb51c97a4a9ec501a43 to your computer and use it in GitHub Desktop.
Debian shell alias
# Place the content of this script at the bottom of your ~/.bashrc file (or ~/.zshrc if you are using ZSH).
# Please be ensure that your shell doesn't have any alias or plugin with the following names: ai, ar, au, af
# Replace 'apt' with 'aptitude' if you want to use it instead,
$PMG="apt"
update() {
sudo $PMG update
}
upgrade() {
sudo $PMG update
sudo $PMG upgrade
}
full() {
sudo $PMG update
sudo $PMG full-upgrade
}
remove() {
local package=$@
if [ -n "${package}" ]; then
sudo $PMG remove $package
else
echo "Error: needs at least one package"
fi
}
install() {
local package=$@
if [ -n "${package}" ]; then
sudo $PMG install $package
else
echo "Error: needs at least one package"
fi
}
debinstall() {
local package=$@
if [ -n "${package}" ]; then
sudo dpkg -i $package
else
echo "Error: needs at least one package"
fi
}
clean() {
sudo $PMG clean
sudo $PMG autoclean
}
alias ai=install
alias au=upgrade
alias af=full
alias ar=remove
alias di=debinstall
alias aup=update
alias ac=clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment