2023-02-23 18:27:26 -08:00
|
|
|
|
|
|
|
#/bin/bash
|
2024-02-12 14:16:57 -08:00
|
|
|
# https://wiki.archlinux.org/title/Pacman
|
2023-02-23 18:27:26 -08:00
|
|
|
alias pm="pacman"
|
|
|
|
alias pms="sudo pacman"
|
2024-08-04 07:59:49 -07:00
|
|
|
# install including needed packages
|
2023-02-23 18:27:26 -08:00
|
|
|
alias pmi="sudo pacman -S --needed"
|
2024-08-04 07:59:49 -07:00
|
|
|
# remove a package and its dependencies which are not required by any other installed package:
|
2023-02-23 18:27:26 -08:00
|
|
|
alias pmr="sudo pacman -Rs"
|
2024-08-04 07:59:49 -07:00
|
|
|
# update all
|
2023-02-23 10:23:19 -08:00
|
|
|
alias pmua="sudo pacman -Syu"
|
2024-08-04 07:59:49 -07:00
|
|
|
# update only the repository database
|
|
|
|
alias pmur="sudo pacman -Syy"
|
|
|
|
# search for packages in the database, searching both in packages' names and descriptions:
|
2023-02-23 18:27:26 -08:00
|
|
|
alias pms="pacman -Ss"
|
2024-08-04 07:59:49 -07:00
|
|
|
# list all installed packages
|
2023-12-14 17:29:19 -08:00
|
|
|
alias pml="pacman -Qe"
|
2024-08-04 07:59:49 -07:00
|
|
|
# list packages with grep
|
2023-12-14 17:29:19 -08:00
|
|
|
alias pmlg="pacman -Qe | grep"
|
|
|
|
# https://unix.stackexchange.com/a/409903/201387
|
2024-08-04 07:59:49 -07:00
|
|
|
# get a list of user added packages
|
2023-12-14 17:29:19 -08:00
|
|
|
alias pmlf="comm -23 <(pacman -Qqett | sort | uniq) <(pacman -Qqg base-devel | sort | uniq)"
|
2024-08-04 07:59:49 -07:00
|
|
|
# get status of a package
|
2023-02-23 18:27:26 -08:00
|
|
|
alias pkgst="pacman -Qi"
|
2024-08-04 07:59:49 -07:00
|
|
|
# get info of a packaage
|
2023-02-23 18:27:26 -08:00
|
|
|
alias pkgi="pacman -Si"
|
2024-08-04 07:59:49 -07:00
|
|
|
# uses pamac to build/update an AUR. use in place of other AUR managers like yay
|
|
|
|
alias pkaurbld="pamac build"
|
2023-02-23 18:27:26 -08:00
|
|
|
|
2024-02-12 14:16:57 -08:00
|
|
|
|
|
|
|
|
2023-02-23 18:27:26 -08:00
|
|
|
pmig () {
|
|
|
|
pacman -Q | grep $1 | cut -d ' ' -f 1
|
|
|
|
}
|
|
|
|
|
|
|
|
pmrg () {
|
|
|
|
pacman -Ssq | grep $1
|
|
|
|
}
|
|
|
|
|
|
|
|
pmnig () {
|
|
|
|
local installed="|$(pmig $1 | tr '\n' '|')"
|
|
|
|
echo $installed
|
|
|
|
pmrg $1 | grep -E -v \'${installed}\'
|
|
|
|
}
|
|
|
|
|
|
|
|
pmnigv () {
|
|
|
|
pacman -Ss $1 | grep -v "$(pacman -Ss $1 | grep "\[installed\]" -A1 )" | grep -v "\[installed\]"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|