[Rpm-maint] [rpm-software-management/rpm] rpmkeys --delete doesn't work for expired gpg keys, rpm --erase does (Issue #4063)

ohorsey notifications at github.com
Tue Dec 9 17:47:56 UTC 2025


ohorsey created an issue (rpm-software-management/rpm#4063)

**Describe the bug**
dnf5 asks me to remove an expired gpg key everytime I run sudo dnf upgrade, but the key is not removed. sudo rpmkeys --delete similarly fails to remove the key, but sudo rpm -e is successful.

```
    The following OpenPGP key (0x3CD989C4) is about to be removed:
     Reason     : Expired on 2025-11-20 14:26:23
     UserID     : "peterwu_rendezvous (None) <peterwu#rendezvous at copr.fedorahosted.org>"
     Fingerprint: 7687850ED2F527603BA0C9EDF9FE02CB3CD989C4
    
    As a result, installing packages signed with this key will fail.
    It is recommended to remove the expired key to allow importing
    an updated key. This might leave already installed packages unverifiable.
    
    The system will now proceed with removing the key.
    Is this ok [y/N]: y
    Key 0x3CD989C4 was successfully removed.
```

I tried `sudo rpmkeys --delete 7687850ed2f527603ba0c9edf9fe02cb3cd989c4` to no avail, but when I used `sudo rpm --erase gpg-pubkey-3cd989c4-5fb9238f` the key finally got erased.



**To Reproduce**
Steps to reproduce the behavior:
1. `sudo faketime '+10years' dnf install <arbitrary-package>`
2. say yes to removing arbitrary keys
3. rpmkeys --list and note that keys are still present

Please link or attach the packages or spec files involved.

**Expected behavior**
Expired GPG keys would be removed

**Output**
If applicable, add copy of the output on the command line or a screenshots to help explain your problem.

**Environment**
 - OS / Distribution: Fedora 43
 - rpm-6.0.0-1.fc43 
 - dnf5-5.2.17.0-2.fc43 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/4063
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/issues/4063 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20251209/ac0b0018/attachment.htm>


More information about the Rpm-maint mailing list