18

I'd like to know if apk add is capable of automatically assuming yes to any prompts when installing a new package on Alpine Linux?

I'm familiar with running something like apt-get install -y curl on Ubuntu and wondering if there's an equivalent command for my use case.

Łukasz D. Tulikowski
  • 1,004
  • 1
  • 9
  • 18
pjlangley
  • 283
  • 1
  • 2
  • 5

2 Answers2

29

apk does not need a --yes argument as it is designed to run non-interactively from the get-go and does not prompt the user unless the -i / --interactive argument is given (and then only for "certain operations").

Ref apk --help --verbose.

user310346
  • 495
  • 5
  • 6
2

I haven't tried it as I could not find a package prompting me, but either yes | apk add <package> (for multiple prompts) or echo y | apk add <package> (in case there is only one prompt) should work.

For details see https://linux.die.net/man/1/yes

wwerner
  • 226
  • 1
  • 5