Skip to content
Latchkey

zypper --non-interactive install on openSUSE

zypper --non-interactive install installs packages on openSUSE and SUSE Linux Enterprise without prompting.

zypper is the SUSE package manager. The --non-interactive (or -n) flag is essential in CI because zypper otherwise prompts for license and conflict decisions.

What it does

zypper install resolves and installs packages from the enabled repositories. --non-interactive auto-answers prompts (including license acceptance and conflict resolution with the default choice), which is required for unattended builds.

Common usage

Terminal
zypper --non-interactive refresh
zypper --non-interactive install --no-recommends \
  git curl ca-certificates
# shorthand
zypper -n in git curl
zypper clean --all

Options

FlagWhat it does
-n / --non-interactiveDo not prompt; accept defaults
--no-recommendsDo not install recommended packages
-i / installInstall packages (in is the alias)
ref / refreshRefresh repository metadata
--gpg-auto-import-keysImport unknown repo keys automatically
clean --allClear cached metadata and packages

In CI

Put --non-interactive before the subcommand (zypper --non-interactive install). Combine with --no-recommends to keep images lean and zypper clean --all to remove caches. Use --gpg-auto-import-keys when adding a new repo in an unattended script.

Common errors in CI

"There are some running programs that use files deleted by recent upgrade" is a warning, not a failure. "No provider of '<pkg>' found" means the package or its repo is missing. "Repository '<name>' is invalid ... Valid metadata not found" means a bad or unreachable repo URL; run zypper refresh. A key prompt that blocks the build means --gpg-auto-import-keys was not passed.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →