various fixes
This commit is contained in:
@@ -10,11 +10,13 @@ if command -v paccache &>/dev/null; then
|
||||
sudo paccache -ruk0
|
||||
fi
|
||||
|
||||
# Report packages that were installed as dependencies and are no longer needed.
|
||||
# Not removed automatically: some may be tools you use directly.
|
||||
ORPHANS="$(pacman -Qtdq 2>/dev/null)"
|
||||
if [ -n "$ORPHANS" ]; then
|
||||
echo "Packages no longer needed by anything:"
|
||||
echo "$ORPHANS" | sed 's/^/ /'
|
||||
echo "To remove them: sudo pacman -Rns \$(pacman -Qtdq)"
|
||||
# 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>
|
||||
mapfile -t ORPHANS < <(pacman -Qtdq 2>/dev/null)
|
||||
if (( ${#ORPHANS[@]} > 0 )); then
|
||||
echo "Removing packages no longer needed by anything:"
|
||||
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>"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user