I'm fairly new to FreeBSD. I write a script to automate unattended installation. I understand that right tool for this job is bsdinstall

Right now I write the setup-script for bsdinstall.

I test this script standalone, not with bsdinstall.

Since pkg is not installed yet, it wants interactive confirmation to bootstrap itself. Can I get rid of this interactive confirmation easily? I want to avoid expect, because I think there must be an easier way.

my attempts sofar:

pkg bootstrap
pkg bootstrap -f
yes | pkg bootstrap
yes | pkg bootstrap -f

Try set ASSUME_ALWAYS_YES variable to yes.

pkg bootstrap

This information written by pkg when invoke yes | pkg bootstrap -f:

Please set ASSUME_ALWAYS_YES=yes environment variable to be able to bootstrap in non-interactive (stdin not being a tty)

  • the notice was never written to the console in my case. ASSUME_ALWAYS_YES works for me, I had to write it like this, though: env ASSUME_ALWAYS_YES=YES pkg bootstrap – murphy Aug 14 '16 at 21:17
  • The command may depends on your shell. – uzsolt Aug 15 '16 at 3:57

Got the same trouble with a brand new jail

the solution:

1- create directory: /usr/local/etc

2- create file: /usr/local/etc/pkg.conf with:


and run:

ASSUME_ALWAYS_YES=yes pkg bootstrap -yf

it should be ok

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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