Never use sudo with makepkg (or with yay, for that matter) , that’s just asking for trouble. You don’t want elevated privileges for various build dependencies, and whatever else there is in the PKGBUILD file.
I’ll be honest i don’t know much about chown and changing permissions and things. Not my forte and in all the time i have used Linux i have not needed to unless it requires me to. I guess i just don’t do the things that require it. When i use yay or makepkg i never use sudo. I agree with @freebird54
EndeavourOS is like a universe! I haven’t been to all the Galaxy’s!
Oh, thanks for telling me. I followed the instruction from the authur of the software, he told me to use sudo, and i thought must sudo in order to clone.
I will try clone without sudo next time. thanks for the good info.
it’s maybe counterintuitive because pacman needs sudo to work, yay however will request elevated privileges only when needed, so it will ask your password only at the step it is required. It doesn’t need sudo from the start.
The reason you shouldn’t use sudo with yay is that running makepkg as root is fundamentally unsafe. It would give a malicious(or broken) PKGBUILD the freedom to do anything it wanted in your system very easily.
If yay needs privileges, it will ask for them. When makepkg needs privileges, it will also ask for them.
On the right side are things you can do with regard to the package (such as view the PKGBUILD file, or its changes this version) and downloading a snap is one such choice. I often read up on a package before adding it, and this is an easy way to get a look at it.