Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 31 down vote accepted

From man pacman:

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.

share|improve this answer
I've never run pacman with the "--noconfirm" in about 3 years of using Arch, because of that warning. How many people run pacman from a script? What are the big risks? I have had to intervene 3 or 4 times to fix things that pacman has refused to upgrade. – Bruce Ediger Oct 19 '12 at 3:18
I assume, given Arch's culture, that the warning is there to discourage complacency and the misguided notion that automating pacman updates is a good idea. A lot of breakage can be put down to people not reading pacman's output; --noconfirm would exacerbate that... – jasonwryan Oct 19 '12 at 3:31
I have an "install" script that uses --noconfirm. The idea is to be able to take a system with a recently updated clean install and make it "usable" without any user interaction. – StrongBad Oct 19 '12 at 9:42
The idea is to install software from a script without any user interaction, so this is perfect. Thanks! – JohannRamos Oct 19 '12 at 12:52
@jasonwryan - I have been trying to generate a silent server setup script for msys2 (future of msysgit) on Windows 8. It emulates arch linux / pacman. I've been unable to get pacman -S --noconfirm --needed bash pacman pacman-mirrors msys2-runtime to execute without prompting me if I want to install. I'm curious if I'm doing something incorrect or if this is just a bug in the port? Any ideas would be welcome... – cchamberlain May 8 '15 at 3:59

The --noconfirm flag will not assume "yes" on every answer. It assumes the default answer which can be "no". To assume "yes", you could pipe the output of the yes command to pacman.

yes | sudo pacman -S firefox
share|improve this answer

The configuration through a .yaourtrc is even better : no additional option to put down on the command line, and a finer control on what you want to do. Check for example : http://kissmyarch.blogspot.fr/2012/05/two-simple-yaourt-tips.html

share|improve this answer
First, the question is about pacman, not yaourt. Second, configuring pacman to say “yes” to every question is an incredibly poor choice. If you ever do want to do this, you should do it explicitly with the argument, not permanently. – HalosGhost Jul 5 '14 at 18:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.