Pacman option to assume “yes” to every question?

When installing software in debian systems we can put something like this:

sudo apt-get install -y chromium-browser

that way the installation occurs automatically, whitout asking to confirm installation [Y/n].
Can i do the same with pacman?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

From man pacman:

–noconfirm
Bypass any and all “Are you sure?” messages. It’s not a good idea to do this unless you want to run pacman from a script.

Note the qualification about using this with care…

Arch is a rolling release, which means pacman has to, from time to time, manage some quite complex upgrades. At these times pacman will prompt you to confirm your choices—disregarding these prompts will generally not be a significant issue, but in some cases, as with the recent move from /lib to /usr/lib , a lack of attention will cause major breakage. This is a not a habit you want to cultivate.

Method 2

While the manpage on the matter is not very clear, the --noconfirm flag will not assume “yes” on every answer. It assumes the default answer which can be “no” sometimes.

–noconfirm
      Bypass any and all “Are you sure?” messages. It’s not a good idea
      to do this unless you want to run pacman from a script

To assume “yes”, you could pipe the output of the yes command to pacman.

yes | sudo pacman -S firefox


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x