Skip to content

Instantly share code, notes, and snippets.

@linuxct
Forked from JuanjoSalvador/debian-shell.sh
Last active August 17, 2017 22:44
Show Gist options
  • Save linuxct/2e5625f0cfa6a0a72dc6188b5efeb7c2 to your computer and use it in GitHub Desktop.
Save linuxct/2e5625f0cfa6a0a72dc6188b5efeb7c2 to your computer and use it in GitHub Desktop.
Archlinux package managers shell aliases
# 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: paci, pacu, pacr, pacq, pacd, pacl
# Replace 'pacman' with 'pacaur' if you want to use it instead,
PMG="pacman"
if [ "$PMG" = "pacman" ]; then
ELEVATOR="sudo"
elif [ "$PMG" = "pacaur" ]; then
ELEVATOR=""
fi
pacu() {
${ELEVATOR} ${PMG} -Syu
}
pacq() {
local package=$@
if [ -n "${package}" ]; then
${ELEVATOR} ${PMG} -Ss $package
else
echo "Error: needs at least one package"
fi
}
pacd() {
local package=$@
if [ -n "${package}" ]; then
${ELEVATOR} ${PMG} -Si $package
else
echo "Error: needs at least one package"
fi
}
pacr() {
local package=$@
if [ -n "${package}" ]; then
${ELEVATOR} ${PMG} -Rs $package
else
echo "Error: needs at least one package"
fi
}
paci() {
local package=$@
if [ -n "${package}" ]; then
${ELEVATOR} ${PMG} -Sy
${ELEVATOR} ${PMG} -S $package
else
echo "Error: needs at least one package"
fi
}
pacc() {
${ELEVATOR} ${PMG} -Scc
}
pacl() {
${ELEVATOR} ${PMG} -Qe | more
}
#alias paci=install
#alias pacu=upgrade
#alias pacr=remove
#alias pacc=clean
#alias pacq=query #search
#alias pacd=details
#alias pacl=list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment