A few things here that you might want to consider/know.
- I am fairly certain that
paccache -ruk0
andpacman -Sc
do the exact same thing. Remove packages you no longer have installed from the cache. There is no reason to call both of them. - Unless you are using a mirror that is severely broken(no out of date, but broken), there is no need to use
-Syyu
when switching mirrors.-Syu
or in your case justyay
is sufficient. - Please be sure you know what
pacman -Rns
actually does and aren’t just copy and pasting it from somewhere else. - You are ranking the EOS mirrors but not the Arch mirrors. Since 99% of the packages come from the Arch mirrors, you might want to add that.
- Is there a reason you are using
echo "$1"
into all those commands?