Red Hat Bugzilla – Bug 1278969
dnf assumes 'n' on key import dialog when using sudo
Last modified: 2015-11-09 08:44:20 EST
+++ This bug was initially created as a clone of Bug #1066044 +++
--- Additional comment from James (purpleidea) on 2015-11-04 01:52:45 EST ---
I can confirm I just experienced this in Fedora 22, when trying to upgrade to Fedora 23:
james@computer:~$ sudo dnf system-upgrade download --releasever=23 --allowerasing
(5489/5489): libreoffice-core-220.127.116.11-1.fc23.x8 141 kB/s | 74 MB 08:56
Total 868 kB/s | 2.6 GB 53:19
warning: /var/lib/dnf/system-upgrade/efivar-libs-0.21-1.fc23.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 34ec9cba: NOKEY
Importing GPG key 0x34EC9CBA:
Userid : "Fedora (23) <email@example.com>"
Fingerprint: EF45 5106 80FB 0232 6B04 5AFB 3247 4CF8 34EC 9CBA
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-23-x86_64
Is this ok [y/N]: The downloaded packages were saved in cache till the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Didn't install any keys
james@computer:~$ sudo rpmkeys --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-23-x86_64
I manually ran this import command to fix the issue.
--- Additional comment from firstname.lastname@example.org on 2015-11-04 02:55:19 EST ---
er...it doesn't look like you answered 'y' to the question whether you wanted to import the key.
--- Additional comment from James (purpleidea) on 2015-11-04 04:15:38 EST ---
(In reply to email@example.com from comment #15)
> er...it doesn't look like you answered 'y' to the question whether you
> wanted to import the key.
I had the same thought, however it never prompted me, the script just exited. Either that or it had a very short timeout and I missed it somehow.
--- Additional comment from firstname.lastname@example.org on 2015-11-04 12:26:31 EST ---
When you run dnf in some sort of non-interactive way it by default answers 'no' to all questions, you can pass '-y' to make it answer 'yes'. Possibly this is happening when you run through sudo, is my only guess? I think I usually run the dnf command directly as root, not sure about other testers.
Can someone else confirm this and make sure it isn't just a timeout?
Yum didn't have this problem, everyone runs it with sudo.
We cannot reproduce. When we upgraded, there were request for import gpg key. y/N and it waits until options were chosen. Incidental enter hit chose N option.
Please if you will provide a reproducer, feel free to open bug again.