Created
November 30, 2021 12:27
-
-
Save sickcodes/37760f4380c6cf22e7b010867a646685 to your computer and use it in GitHub Desktop.
Revisions
-
sickcodes created this gist
Nov 30, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ #!/bin/bash # Author: sickcodes # Contact: https://twitter.com/sickcodes # Copyright: sickcodes (C) 2021 # License: GPLv3+ # reinstall all packages, unattended # does not include any manual makepkg'ed installations # said packages, plus any unavailable AUR packages will be listed at ~/yay_reinstall_failed.log # you need to be a NOPASSWD sudoer # user ALL=(ALL) NOPASSWD: ALL native_packages (){ ALL_PACKAGES="$(sudo pacman -Qqn)" IGNORABLES="$(grep --no-filename ^IgnorePkg /etc/pacman.* 2>/dev/null \ | sed -E -e 's/IgnorePkg[\ ]+\=[\ ]+//g')" yes | sudo pacman -Qqn \ | grep -v "${IGNORABLES}" \ | sudo pacman -Syu - --noconfirm } yays (){ MANUAL_PACKAGES=($(sudo pacman -Qm -q)) for PACKAGE in "${MANUAL_PACKAGES[@]}"; do yes | yay -S "${PACKAGE}" --noconfirm case $? in 0 ) true ;; 1 ) tee -a ~/yay_reinstall_failed.log <<< "${PACKAGE}" ;; esac yes | yay -Scc --noconfirm done } native_packages yays