linuxShortcuts/Pacman/updateRepositories.sh

33 lines
688 B
Bash
Raw Normal View History

2018-08-09 02:56:36 +00:00
BOLD='\e[91m'
NC='\e[39m'
function bold() {
echo -e "\n\n${BOLD}$1${NC}"
2018-08-09 02:56:36 +00:00
}
function s() {
sudo $*
}
2021-03-24 02:14:15 +00:00
s -v
bold "Pacman-mirrors --continent"
s "pacman-mirrors --continent" 2>/dev/null
# s "pacman-mirrors -c Brazil" 2>/dev/null
s "reflector -l 30 -f 10 --save /etc/pacman.d/mirrorlist" 2>/dev/null
2018-08-09 17:45:26 +00:00
# From now on, exit when any command fails
set -e
s -v
bold "Updating..."
2022-04-01 23:20:13 +00:00
yay -Syu --sudoloop --answerclean none --answerdiff all --answerupgrade all --noremovemake --nobatchinstall --cleanafter
2018-08-09 17:45:26 +00:00
2018-08-09 02:56:36 +00:00
bold "Cleaning stuff..."
s -v
yay -Sc --noconfirm 2>/dev/null
s -v
yes | (sudo -S pacman -Rns $(pacman -Qtdq) --color always 2>/dev/null)
2018-08-09 17:45:26 +00:00
s -k
notify-send "Update script has finished!"