SLES12 SP2 problem with zypper and no-gpg-checks

Hi all,

when I add a repo with zypper ar --no-gpg-checks URI name it seems not to work. Packages without key cause an error which says that there is no public key for the package and I can choose to abort, retry or ignore. In sles12 this only gives a warning but no interactivity.
“man zypper” shows that I now can use zypper ar --no-gpgcheck URI name or the “-G”-option. Both give an error “unknown option…”. The same error occurs if I try zypper install --no-gpgcheck PACKAGE or with “-G” or “–no-gpg-checks”.
So what is now the right way to install unsigned packages without user-interactivity (specially in scripts)?

Ok, reason is found. Instead of zypper install --no-gpgckeck PACKAGE it must be zypper --no-gpg-checks install PACKAGE --no-gpg-checks is a global option so it must be given before the COMMAND is called. --no-gpgcheck is not a valid option for “install”.

To be honest: this syntax is creepy. I’ve never seen it before that options are distinguished in global-options and "sub"command-options inside a command.

On 09/12/16 08:44, tgajewski wrote:
[color=blue]

Ok, reason is found. Instead of
Code:

zypper install --no-gpgckeck PACKAGE

it must be
Code:

zypper --no-gpg-checks install PACKAGE

–no-gpg-checks is a global option so it must be given before the
COMMAND is called. --no-gpgcheck is not a valid option for “install”.[/color]

Firstly thanks for taking the time to report back.

zypper addrepo (ar) uses --gpgcheck and --no-gpgcheck whereas zypper
install (in) inherits --no-gpg-checks from the main zypper command
(there is no --gpg-checks parameter).

My guess is that they’re differently named to distinguish one from the
other except that they appear to duplicate each other so I’m going to
flag this to my SUSE contacts in case something needs changing.
[color=blue]

To be honest: this syntax is creepy. I’ve never seen it before that
options are distinguished in global-options and "sub"command-options
inside a command.[/color]

Whilst zypper might seem odd it’s not the only command which has
sub-commands with different options - one obvious one is ‘git’.

HTH.

Simon
SUSE Knowledge Partner


If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below. Thanks.