Commit 0608bb76 authored by Harald Nordgren's avatar Harald Nordgren Committed by Marc Cornellà
Browse files

Use 'apt' instead of 'apt-get' for Ubuntu >=16.04 (#5787)

parent 919f0a42
...@@ -5,18 +5,21 @@ ...@@ -5,18 +5,21 @@
# https://github.com/trinaldi # https://github.com/trinaldi
# Nicolas Jonas nextgenthemes.com # Nicolas Jonas nextgenthemes.com
# https://github.com/loctauxphilippe # https://github.com/loctauxphilippe
# https://github.com/HaraldNordgren
# #
# Debian, Ubuntu and friends related zsh aliases and functions for zsh # Debian, Ubuntu and friends related zsh aliases and functions for zsh
(( $+commands[apt] )) && APT=apt || APT=apt-get
alias acs='apt-cache search' alias acs='apt-cache search'
compdef _acs acs='apt-cache search' compdef _acs acs='apt-cache search'
alias afs='apt-file search --regexp' alias afs='apt-file search --regexp'
compdef _afs afs='apt-file search --regexp' compdef _afs afs='apt-file search --regexp'
# These are apt-get only # These are apt/apt-get only
alias ags='apt-get source' # asrc alias ags="$APT source" # asrc
compdef _ags ags='apt-get source' compdef _ags ags="$APT source"
alias acp='apt-cache policy' # app alias acp='apt-cache policy' # app
compdef _acp acp='apt-cache policy' compdef _acp acp='apt-cache policy'
...@@ -37,33 +40,33 @@ compdef _afu afu='sudo apt-file update' ...@@ -37,33 +40,33 @@ compdef _afu afu='sudo apt-file update'
alias ppap='sudo ppa-purge' alias ppap='sudo ppa-purge'
compdef _ppap ppap='sudo ppa-purge' compdef _ppap ppap='sudo ppa-purge'
alias apg='sudo apt-get' # age - but without sudo alias ag="sudo $APT" # age - but without sudo
alias aga='sudo apt-get autoclean' # aac alias aga="sudo $APT autoclean" # aac
alias agb='sudo apt-get build-dep' # abd alias agb="sudo $APT build-dep" # abd
alias agc='sudo apt-get clean' # adc alias agc="sudo $APT clean" # adc
alias agd='sudo apt-get dselect-upgrade' # ads alias agd="sudo $APT dselect-upgrade" # ads
alias agi='sudo apt-get install' # ai alias agi="sudo $APT install" # ai
alias agp='sudo apt-get purge' # ap alias agp="sudo $APT purge" # ap
alias agr='sudo apt-get remove' # ar alias agr="sudo $APT remove" # ar
alias agu='sudo apt-get update' # ad alias agu="sudo $APT update" # ad
alias agud='sudo apt-get update && sudo apt-get full-upgrade' #adu alias agud="sudo $APT update && sudo $APT dist-upgrade" #adu
alias agug='sudo apt-get upgrade' # ag alias agug="sudo $APT upgrade" # ag
alias aguu='sudo apt-get update && sudo apt-get upgrade' #adg alias aguu="sudo $APT update && sudo $APT upgrade" #adg
alias agar='sudo apt-get autoremove' alias agar="sudo $APT autoremove"
compdef _ag apg='sudo apt-get' compdef _ag ag="sudo $APT"
compdef _aga aga='sudo apt-get autoclean' compdef _aga aga="sudo $APT autoclean"
compdef _agb agb='sudo apt-get build-dep' compdef _agb agb="sudo $APT build-dep"
compdef _agc agc='sudo apt-get clean' compdef _agc agc="sudo $APT clean"
compdef _agd agd='sudo apt-get dselect-upgrade' compdef _agd agd="sudo $APT dselect-upgrade"
compdef _agi agi='sudo apt-get install' compdef _agi agi="sudo $APT install"
compdef _agp agp='sudo apt-get purge' compdef _agp agp="sudo $APT purge"
compdef _agr agr='sudo apt-get remove' compdef _agr agr="sudo $APT remove"
compdef _agu agu='sudo apt-get update' compdef _agu agu="sudo $APT update"
compdef _agud agud='sudo apt-get update && sudo apt-get full-upgrade' compdef _agud agud="sudo $APT update && sudo $APT dist-upgrade"
compdef _agug agug='sudo apt-get upgrade' compdef _agug agug="sudo $APT upgrade"
compdef _aguu aguu='sudo apt-get update && sudo apt-get upgrade' compdef _aguu aguu="sudo $APT update && sudo $APT upgrade"
compdef _agar agar='sudo apt-get autoremove' compdef _agar agar="sudo $APT autoremove"
# Remove ALL kernel images and headers EXCEPT the one in use # Remove ALL kernel images and headers EXCEPT the one in use
alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \ alias kclean='sudo aptitude remove -P ?and(~i~nlinux-(ima|hea) \
...@@ -91,8 +94,8 @@ aar() { ...@@ -91,8 +94,8 @@ aar() {
PACKAGE=${1##*/} PACKAGE=${1##*/}
fi fi
sudo apt-add-repository $1 && sudo apt-get update sudo apt-add-repository $1 && sudo $APT update
sudo apt-get install $PACKAGE sudo $APT install $PACKAGE
} }
# Prints apt history # Prints apt history
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment