Software installation via yay and autoanswer for repository number


To save some time, I’m piecing together a bash script to install all of the software I use, so that when I want to reinstall or install elsewhere I can have it churn through what I want in the script automatically.

Does anyone know if there is a way to auto insert an answer for the repository prompt?


yay -S --answerdiff None --answerclean None --removemake obs-streamfx

There are two repositories 1) obs-streamfx 2) obs-streamfx-git, so I would want it to just choose either the default or be able to autoanswer 1, either would be good.

I’ve been looking through the man pages for yay and I can’t see any option for this.

With pacman I can use yes | sudo pacman -Syu blender to auto answer yes, so I thought I’d give that a go, but having a number before the pipe just throws an error.


For a “unattended update” script of mine, I use …

--nodiffmenu --combinedupgrade --sudoloop --noconfirm

1 Like

Thanks, but I was wanting to know how to select which repository within the script so I wouldn’t have to keep entering a number for each piece of software.



You can also restrict the repository to AUR with --aur, if you have additional repos like chaoticaur for instance.

I just tried
yay -S obs-streamfx --aur --noconfirm
and it went through without any problems.


Oh, that was absolute magic, thank you that works great!!! :slight_smile:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.