I have installed
aurman from the AUR, and every time I install a package, it says that packages are neither in the repos nor the AUR. Is there a way to remove them without removing them manually like
sudo pacman -Rsn <package 1> <package 2>...?
pacman, by definition, can only know about packages that are in its database; so either those installed by pacman or an AUR helper that wraps pacman/makepkg.
Anything that you have installed without pacman, eg., using something like pip or gem, is your responsibility.
So even your example (
sudo pacman -Rsn <package>) will not work as these packages are not in the database. There is a process outlined on the wiki to help identify potential candidates, but they still must be removed manually (ie., with
rm), and with caution.
The only other category of package that could be covered by this scenario is an AUR package that has subsequently been deleted, and then it would be necessary to use pacman to remove it; this could be done with
# pacman -Rns $(pacman -Qtdq).