addet more support for opensuse and streamlined the packager function
This commit is contained in:
parent
cb928bb0b4
commit
cfec752bf3
1 changed files with 58 additions and 65 deletions
85
.zshrc
85
.zshrc
|
@ -519,72 +519,65 @@ if command_exists rsync; then
|
|||
fi
|
||||
|
||||
get_packager() {
|
||||
search=""
|
||||
install=""
|
||||
update=""
|
||||
upgrade=""
|
||||
refresh=""
|
||||
remove=""
|
||||
. /etc/os-release
|
||||
case "$ID" in
|
||||
# Debian-based
|
||||
ubuntu|debian|pop|kali|zorin)
|
||||
if command_exists nala; then
|
||||
search="nala search"
|
||||
install="nala install --assume-yes"
|
||||
refresh="nala update"
|
||||
upgrade="nala upgrade --full"
|
||||
remove="nala purge"
|
||||
clean="nala autoremove --assume-yes"
|
||||
alias update="$_sudo $refresh && $_sudo $upgrade"
|
||||
alias install="$_sudo $refresh && $_sudo $install"
|
||||
alias remove="$_sudo $remove"
|
||||
alias search="$search"
|
||||
elif command_exists apt-get; then
|
||||
search="apt-cache search"
|
||||
install="apt-get install --yes"
|
||||
refresh="apt-get update"
|
||||
upgrade="apt-get upgrade"
|
||||
remove="apt-get purge"
|
||||
clean="apt-get autoremove"
|
||||
alias update="$_sudo $refresh && $_sudo $upgrade"
|
||||
alias install="$_sudo $refresh && $_sudo $install"
|
||||
alias remove="$_sudo $remove"
|
||||
alias search="$search"
|
||||
alias search="nala search"
|
||||
alias install="$_sudo nala install --assume-yes"
|
||||
alias update="$_sudo nala update && $_sudo nala upgrade --full"
|
||||
alias remove="$_sudo nala purge"
|
||||
else
|
||||
alias search="apt-cache search"
|
||||
alias install="$_sudo apt-get install --yes"
|
||||
alias update="$_sudo apt-get update && $_sudo apt-get upgrade"
|
||||
alias remove="$_sudo apt-get purge"
|
||||
fi
|
||||
alias unbreak="$_sudo dpkg --configure -a"
|
||||
;;
|
||||
|
||||
# Arch-based
|
||||
arch|manjaro|endevouros|garuda)
|
||||
if command_exists yay; then
|
||||
alias install="yay -S --noconfirm"
|
||||
alias update="yay -Syu"
|
||||
alias remove="yay -R"
|
||||
alias search="yay -Ss"
|
||||
elif command_exists paru; then
|
||||
if command_exists paru; then
|
||||
alias search="paru -Ss"
|
||||
alias install="paru -S --noconfirm"
|
||||
alias update="paru -Syu"
|
||||
alias remove="paru -R"
|
||||
alias search="paru -Ss"
|
||||
elif command_exists pacman; then
|
||||
elif command_exists yay; then
|
||||
alias search="yay -Ss"
|
||||
alias install="yay -S --noconfirm"
|
||||
alias update="yay -Syu"
|
||||
alias remove="yay -R"
|
||||
else
|
||||
alias search="$_sudo pacman -Ss"
|
||||
alias install="$_sudo pacman -S --noconfirm"
|
||||
alias update="$_sudo pacman -Syu"
|
||||
alias remove="$_sudo pacman -R"
|
||||
alias search="$_sudo pacman -Ss"
|
||||
fi
|
||||
;;
|
||||
|
||||
# RHEL-based
|
||||
fedora|centos)
|
||||
alias install="dnf install --yes"
|
||||
alias update="dnf update"
|
||||
alias remove="dnf remove"
|
||||
alias search="dnf search"
|
||||
alias install="$_sudo dnf install --yes"
|
||||
alias update="$_sudo dnf update"
|
||||
alias remove="$_sudo dnf remove"
|
||||
;;
|
||||
|
||||
# openSUSE
|
||||
opensuse-*)
|
||||
alias search="zypper search"
|
||||
alias install="$_sudo zypper install --no-confirm"
|
||||
alias update="$_sudo zypper update"
|
||||
alias remove="$_sudo zypper remove"
|
||||
;;
|
||||
|
||||
# Alpine
|
||||
alpine)
|
||||
install="apk add"
|
||||
update="apk update"
|
||||
upgrade="apk upgrade"
|
||||
remove="apk del"
|
||||
alias install="$_sudo $install"
|
||||
alias update="$_sudo $update && $_sudo $upgrade"
|
||||
alias remove="$_sudo $remove"
|
||||
alias install="$_sudo apk add"
|
||||
alias update="$_sudo apk update && $_sudo apk upgrade"
|
||||
alias remove="$_sudo apk del"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue