zypper --non-interactive asks "Do you agree with the terms of the license"

I try to use zypper in a script in non-interactive mode to upgrade all packages:

sudo zypper --non-interactive --no-gpg-checks --gpg-auto-import-keys --non-interactive-include-reboot-patches update

It answers the first question “Continue?” correctly with yes.
The second question is “Do you agree with the terms of the license?”, and it answers it with its default no.
Which of course causes the whole operation to be aborted.

I read in this post from 2007 that “zypper should now (version 0.8.3+) finally be ready for use in automated
processes by providing several new options”. One of the options described there, is:

  • –auto-agree-with-licenses
    special option for install and update commands. By using this, user declares he/she agrees with terms of licenses the command will install, and zypper will automatically say yes to license confirmation prompt.

This sounds like exactly what I would need.

However, the zypper 1.11.32 in openSUSE 13.2 does not support his option, and none of the other options that seem to have to do with interactiveness seem to handle this.

I also need to use zypper in non-interactive mode to install packages.

My questions are:

  • What happened to the --auto-agree-with-licenses option?
  • Is there a way to get the license question answered with yes, non-interactively?


Works in 1.11.34. Upgrade, hmm?

Just a comment… those aren’t really used for package install, they’re used for repo management.

You might be interested in a flawed script I’ve created for installing Devstack on openSUSE/SUSE

It’s flawed because there is a zypper bug which can’t suppress the message that pops up after the zypper package installs which asks whether the User would like to read notifications (AFAIK there is no current solution). But, it illustrates how you use the other command switches and otherwise the script works.