niquelnausea
(usa Arch Linux)
Enviado em 08/08/2018 - 21:03h
uso este script para deletar os pacotes desnecessários
#!/bin/sh
# undeps - This script lists and removes UNneeded DEPendencieS on Arch Linux
# Options: -l <list> | -r <remove> | -ra <remove all - recursive>
# Estêvão Valadão - estevao@archlinux-br.org
loopflag=0
case "$1" in
-l)
echo ""
echo "** UNNEEDED DEPENDENCIES **"
echo "-> checking dependencies..."
echo ""
/usr/bin/pacman -Qdtq
if [ "$?" = 1 ]; then
echo "-> Your system doesn't have unneeded dependencies."
fi
echo ""
;;
-r)
while [ "$loopflag" = 0 ]
do
echo ""
echo "** UNNEEDED DEPENDENCIES **"
echo "-> checking dependencies..."
echo ""
/usr/bin/pacman -Qdtq
if [ "$?" = 0 ]; then
echo ""
echo -n "Do you want to remove these packages? [Y/n] "
read option
if [ "$option" = "y" ] || [ "$option" = "" ]; then
if [ -f /usr/bin/sudo ]; then
/usr/bin/sudo /usr/bin/pacman -Rn $(pacman -Qdtq)
echo "-> Unneeded dependencie(s) sucessfully removed."
echo ""
else
/usr/bin/pacman -Rn $(pacman -Qdtq)
echo "-> Unneeded dependencie(s) sucessfully removed."
echo ""
fi
elif [ "$option" = "n" ]; then
exit 0
fi
else
loopflag=1
echo "-> Your system doesn't have unneeded dependencies."
echo ""
fi
done
;;
-ra)
/usr/bin/pacman -Qdtq > /dev/null
if [ "$?" = 1 ]; then
echo ""
echo "** UNNEEDED DEPENDENCIES **"
echo "-> checking dependencies..."
echo ""
echo "-> Your system doesn't have unneeded dependencies."
echo ""
else
echo ""
echo "** UNNEEDED DEPENDENCIES - RECURSIVE **"
echo -n "-> "
if [ -f /usr/bin/sudo ]; then
/usr/bin/sudo /usr/bin/pacman -Rsn $(pacman -Qdtq)
else
/usr/bin/pacman -Rsn $(pacman -Qdtq)
fi
fi
;;
*)
echo "Usage: $0 {-l <list> | -r <remove> | -ra <remove all - recursive>}"
echo ""
esac
exit 0
e para limpar o cache da para usar "pacman -Sc" (apenas os pacotes não instalados) ou "pacman -Scc" (todo o cache).
sobre a limpeza dos pacotes parciais, da para rodar no terminal algo parecido com um "rm -R /var/cache/pacman/pkg/*.part".