rpm -qa --qf '%-30{DISTRIBUTION} %{NAME}\n'| sort
gives you a list of all repos used by your packages. Finding the ones you don't want is left as an exercise to the reader. :-)
.
In general, you should use --non-interactive
mode, in shortcut -n
, when running zypper non-interactively:
zypper -n install curl
That might seem confusing for someone coming from apt-get install -y curl
. Some zypper sub-commands also support a command-specific -y
/--no-confirm
option as an alias for -n
/--non-interactive
, but not all sub-commands do. As the install
command does implement that, this command is equivalent to the above:
zypper install -y curl
Note that the -y
must come after install
, while the global -n
option comes before the subcommand (zypper install -n
means something different; read the man page for that).
[Edit] The section below is no longer accurate, but is retained for historical reference. Current zypper supports the --gpg-auto-import-keys
option to automatically import and trust the gpg keys associated with a new repository.
According to documentation there's no way how to accept a GPG key without interactive mode:
a new key can be trusted or imported in the interactive mode only
Even with --no-gpgp-checks
the GPG key will be rejected.
A workaround for scripts is to use pipe and echo
:
zypper addrepo http://repo.example.org my_name | echo 'a'
Best Answer
I think there is no such command. You can list packages from specific repository:
or all orphaned packages if you've already removed that repository:
Then you could try to
cut
package names from the output and pass it tozypper remove
if it's worth the effort.