You are not logged in.

#1 2012-10-26 14:40:10

r0ach
Member
From: India
Registered: 2012-10-25
Posts: 11

How to Prevent Pacman from asking Confirmation (Y/n) questions?

I want to put a couple pacman install commands in a ".sh" file and want it to download and install on itself. I know I can do it by:

pacman -S <package1> <package2>

But thats not what I want. I want pacman to entirely bypass the "Proceed to install?" question. Is there a way to do this?

P.S: Is this plain stupid?

"y" | pacman -S <package>

Last edited by r0ach (2012-10-26 14:40:33)

Offline

#2 2012-10-26 14:47:46

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: How to Prevent Pacman from asking Confirmation (Y/n) questions?

Doesn't this do what you want?

 --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.

All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#3 2012-10-26 14:48:15

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,784
Website

Re: How to Prevent Pacman from asking Confirmation (Y/n) questions?

You don't want to blindly pipe "yes" into pacman, you're likely to break things. Read up on "--noconfirm" in 'man pacman'.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 2012-10-26 14:55:19

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: How to Prevent Pacman from asking Confirmation (Y/n) questions?

Even --noconfirm kind of scares me...

Offline

#5 2012-10-26 15:00:01

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 4,645

Re: How to Prevent Pacman from asking Confirmation (Y/n) questions?

r0ach wrote:

P.S: Is this plain stupid?

Yes. (well, you asked smile)


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

#6 2012-10-26 15:03:43

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,784
Website

Re: How to Prevent Pacman from asking Confirmation (Y/n) questions?

WonderWoofy wrote:

Even --noconfirm kind of scares me...

That will just the default option, so it's a little safer. e.g. when confronted with "foo and bar are in conflict. Remove bar? [y/N]" noconfirm will choose "N".


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#7 2012-10-26 15:04:56

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: How to Prevent Pacman from asking Confirmation (Y/n) questions?

That is a good point WorMzy... thanks, I am slightly braver thanks to you.

Offline

#8 2012-10-26 15:15:44

r0ach
Member
From: India
Registered: 2012-10-25
Posts: 11

Re: How to Prevent Pacman from asking Confirmation (Y/n) questions?

loafer wrote:

Doesn't this do what you want?

 --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.

I ran through the man pages. But didn't see this. How clumsy of me?!

So, you guys are saying this is very bad idea huh? Hmm.. Anywho, thank you for answering the question. You guys are awesome!

Offline

#9 2012-10-26 15:39:12

satanselbow
Member
Registered: 2011-06-15
Posts: 538

Re: How to Prevent Pacman from asking Confirmation (Y/n) questions?

r0ach wrote:

So, you guys are saying this is very bad idea huh? Hmm.. Anywho, thank you for answering the question. You guys are awesome!



I might use the --noconfirm flag after vetting the list of upgrades available with a -Syyu which contained a larger then expect number of "application" packages - especially true with anything from the AUR... anything mission critical would get my full attention however (kernel upgrades etc).

The only other "fair use" of --noconfirm might be when doing a scripted install from a personal repo... In which case you are probably prepared to clean up the carnage and run the risk anyway wink

Offline

#10 2012-10-26 21:39:51

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: How to Prevent Pacman from asking Confirmation (Y/n) questions?

satanselbow wrote:

especially true with anything from the AUR...

The OP is specifically referring to "pacman -S".  I am not sure why you think pacman installs packages from the AUR or if this is just a mistake in your post, but just to be clear pacman does not install from the AUR.

edit: typo

Last edited by loafer (2012-10-26 21:40:25)


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#11 2012-10-27 08:03:57

satanselbow
Member
Registered: 2011-06-15
Posts: 538

Re: How to Prevent Pacman from asking Confirmation (Y/n) questions?

loafer wrote:

I am not sure why you think pacman installs packages from the AUR or if this is just a mistake in your post, but just to be clear pacman does not install from the AUR.

Pedantic but true... same switches are available when making use of yaourt to sync AUR.

Offline

#12 2012-10-27 23:43:05

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: How to Prevent Pacman from asking Confirmation (Y/n) questions?

satanselbow wrote:
loafer wrote:

I am not sure why you think pacman installs packages from the AUR or if this is just a mistake in your post, but just to be clear pacman does not install from the AUR.

Pedantic but true... same switches are available when making use of yaourt to sync AUR.

And if any Arch user does not know how to differentiate between yaourt and pacman (or between AUR and the repos), system breakage is eventually to be expected anyway. I don't think yaourt deserves a place in this discussion at all, its a helper, not an official expansion.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

Board footer

Powered by FluxBB