trim down install, tighten sshd
This commit is contained in:
+4
-6
@@ -10,14 +10,12 @@ YAY_FLAGS="--noconfirm --answerdiff=None --answeredit=None --answerclean=None"
|
||||
if ! yay --version &>/dev/null; then
|
||||
echo "yay is broken (likely a libalpm bump). Rebuilding yay..."
|
||||
sudo pacman -R --noconfirm yay
|
||||
cd /tmp
|
||||
cd /tmp || exit 1
|
||||
rm -rf yay
|
||||
git clone https://aur.archlinux.org/yay.git
|
||||
cd yay
|
||||
git clone https://aur.archlinux.org/yay.git && cd yay || exit 1
|
||||
makepkg -si --noconfirm
|
||||
cd ..
|
||||
rm -rf yay
|
||||
cd
|
||||
cd .. && rm -rf yay
|
||||
cd || exit 1
|
||||
fi
|
||||
|
||||
yay -Sua $YAY_FLAGS
|
||||
|
||||
@@ -50,7 +50,7 @@ reinstall_incompatible_extensions() {
|
||||
rm -rf "$backup"
|
||||
else
|
||||
echo "Reinstall of $uuid failed; restoring the previous version."
|
||||
rm -rf "$ext_root/$uuid"
|
||||
rm -rf "${ext_root:?}/$uuid"
|
||||
mv "$backup/$uuid" "$ext_root/$uuid"
|
||||
rmdir "$backup"
|
||||
fi
|
||||
|
||||
+12
-6
@@ -10,13 +10,19 @@ if command -v paccache &>/dev/null; then
|
||||
sudo paccache -ruk0
|
||||
fi
|
||||
|
||||
# Remove packages that were installed as dependencies and are no longer needed
|
||||
# (packages something lists as an optional dependency are kept). To keep one
|
||||
# you use directly: sudo pacman -D --asexplicit <package>
|
||||
# Offer to remove packages that were installed as dependencies and are no
|
||||
# longer needed (packages something lists as an optional dependency are kept).
|
||||
# Ask first: one may be something you use directly. Without a terminal to ask
|
||||
# on, keep them. To keep one for good: sudo pacman -D --asexplicit <package>
|
||||
mapfile -t ORPHANS < <(pacman -Qtdq 2>/dev/null)
|
||||
if (( ${#ORPHANS[@]} > 0 )); then
|
||||
echo "Removing packages no longer needed by anything:"
|
||||
echo "These packages were installed for something else, and nothing needs them any more:"
|
||||
printf ' %s\n' "${ORPHANS[@]}"
|
||||
sudo pacman -Rns --noconfirm "${ORPHANS[@]}" || exit 1
|
||||
echo "To get one of these back, reinstall it with: sudo pacman -S <package>"
|
||||
if { : < /dev/tty; } 2> /dev/null && read -rp "Remove them? [y/N] " answer < /dev/tty \
|
||||
&& [[ "$answer" == [yY]* ]]; then
|
||||
sudo pacman -Rns --noconfirm "${ORPHANS[@]}" || exit 1
|
||||
echo "To get one of these back, reinstall it with: sudo pacman -S <package>"
|
||||
else
|
||||
echo "Kept them. To keep one for good, so you're not asked again: sudo pacman -D --asexplicit <package>"
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user