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?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityFrom 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.
--noconfirm
would exacerbate that...
Oct 19, 2012 at 3:31
--noconfirm
doesn't assume yes
, instead it assumes the default answer, which is quite often no
. Example: # pacman -Scc Cache directory: /var/cache/pacman/pkg/ :: Do you want to remove ALL files from cache? [y/N]
For the case above, yes|pacman -Scc
assumes yes
pacman --noconfirm
is required if you are using a Docker container, otherwise, it will just wait for an input, and thus shutting down the container with an error.
Mar 31, 2019 at 19:12
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
yes | LC_ALL=en_US.UTF-8 pacman [...]
for compatibility with systems whose language is not set to English. Otherwise the [Y/n]
questions become [J/n]
, for example.
y
answer, e.g. Enter a selection (default=all)
.
pacman
, it would be easier, and probably safer to just to do yes J | sudo pacman -S firefox
in that case. yes J
will cause yes
to repeatidly output a J
instead of a y
.
Jan 12, 2019 at 16:20
J
(or Y
) meaning "no" or "all".