Bug 2476993 - DNF5 does not record installation repository for packages that were upgraded in a failed RPM transaction
Summary: DNF5 does not record installation repository for packages that were upgraded ...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf5
Version: 43
Hardware: Unspecified
OS: Linux
low
medium
Target Milestone: ---
Assignee: rpm-software-management
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-05-13 12:22 UTC by John Dodson
Modified: 2026-11-10 19:46 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:
fedora-admin-xmlrpc: mirror+


Attachments (Terms of Use)
dnf5 system-upgrade log (3.92 MB, text/plain)
2026-05-25 11:12 UTC, John Dodson
no flags Details

Description John Dodson 2026-05-13 12:22:37 UTC
Following offline upgrade FC43->44 almost all packages had "unknown" as the repo this didn't happen 42->43

dnf -q list --installed|grep unknown|wc -l
3503
dnf -q list --installed|wc -l
3588

Reproducible: Always

Steps to Reproduce:
1. Upgrade FC43->FC44 using advice at:

https://docs.fedoraproject.org/en-US/quick-docs/upgrading-fedora-offline/

dnf -q list --installed|grep unknown|wc -l
will give a lot of unknown repos for packages.

2. As they update from the set repo they become fedora/updates (obviously)

3. There needs to be a way of "correcting" this without reinstalling individual
packages.
Actual Results:
dnf -q list --installed|grep unknown|wc -l
3503
dnf -q list --installed|wc -l
3588

Expected Results:
dnf -q list --installed|grep unknown|wc -l
0
dnf -q list --installed|wc -l
3588

Comment 1 Petr Pisar 2026-05-14 14:22:46 UTC
System upgrade is performed with DNF5 of the old system. In this case Fedora 43. Mobving this bug report version to 43.

If this is always reproducible, it's not a problem for you to obtain "dnf -q list --installed|grep unknown" before the upgrade and after the upgrade and provide them us together with a log from the upgrade ("dnf5 system-upgrade log --number=N").

Comment 2 Petr Pisar 2026-05-14 14:35:03 UTC
Last known bug like this one was #2346690 fixed in dnf5-5.2.11.0-1.fc43. Did you use up-to-date dnf5 for the upgrade.

Another possible cause is that you installed/updated packages before the system upgrade with different tool than dnf5 and you just did not notice that the from-repository details disappeared already before the system upgrade.

Another possible explanation is that your /usr/lib/sysimage/libdnf5/nevras.toml got corrupted/removed any time before you noticed the from-repository details are missing.

Comment 3 Petr Pisar 2026-05-14 14:37:18 UTC
> There needs to be a way of "correcting" this without reinstalling individual
packages.

You manually write the missing data into /usr/lib/sysimage/libdnf5/nevras.toml. There is no automated way of doing it provided by DNF5.

Comment 4 Petr Pisar 2026-05-14 15:09:56 UTC
I've just tested a system upgrade with dnf5-5.2.18.0-3.fc43.x86_64 and unfortunately I cannot reproduce it, there are no new packages installed from "unknown" repository after the upgrade.

Comment 5 John Dodson 2026-05-18 02:53:48 UTC
I upgraded another machine today...

Before...
# dnf -q list --installed dnf5
Installed packages
dnf5.x86_64 5.2.18.0-3.fc43 updates

After...
dnf -q list --installed dnf5
Installed packages (available for reinstall, available for upgrade)
dnf5.x86_64 5.4.2.0-1.fc44 <unknown>

All other packages are "unknown" other that .fc43 & previous that were not updated.

I can send these lists/data & the log you want, but perhaps not publicly readable?

The nevras file has not changed & does not contain "unknown" entries.

# ls -l /usr/lib/sysimage/libdnf5/
total 61896
drwxrwx---. 4 root root     4096 May 18 11:22 comps_groups
-rw-rw----. 1 root root      353 May 17 17:41 environments.toml
-rw-rw----. 1 root root     3472 May 17 17:41 groups.toml
-rw-rw----. 1 root root      106 May 17 17:41 modules.toml
-rw-rw----. 1 root root   219862 May 17 17:41 nevras.toml
drwxrwx---. 4 root root     4096 May 18 07:33 offline
-rw-rw----. 1 root root   162983 May 17 17:41 packages.toml
-rw-rw----. 1 root root        0 May 18 11:44 system-repo.lock
-rw-rw----. 1 root root      110 May 17 17:41 system.toml
-rw-r-----. 1 root root  4177920 May 18 11:22 transaction_history.sqlite
-rw-r-----. 1 root root   131072 May 18 11:22 transaction_history.sqlite-shm
-rw-r-----. 1 root root 58644112 May 18 11:22 transaction_history.sqlite-wal

Comment 6 Petr Pisar 2026-05-18 07:43:24 UTC
How did you perform the offline upgrade? From a command line with some command, or from GUI with some graphical application? I suspect that you actually performed the upgrade using DNF4. Not DNF5.

Bugzilla supports restricting access to attachments to Red Hat employees. Is that private enough for you? Or you can encrypt them using E3F42FCE156830A80358E6E94FD1AEC3365AF7BF OpenGPG key.

Comment 7 John Dodson 2026-05-25 11:12:28 UTC
Created attachment 2142834 [details]
dnf5 system-upgrade log

I don't see anything sensitive after all...

Comment 8 John Dodson 2026-05-25 11:16:24 UTC
Yes, command line.

dnf upgrade --refresh
dnf system-upgrade download --releasever=44
dnf offline reboot
or it may have been,
dnf system-upgrade reboot

# dnf5 system-upgrade log
The following boots appear to contain offline transaction logs:
1 / 37d55abcb2e448d1b6aecf3560750241: 2024-11-09 05:53:18 40→41
2 / 1336fc85992c4c6a9458b64b1b9d1f45: 2025-04-24 05:21:05 41→42
3 / 7f82465d3cd44c1eb70f012aecd0d744: 2025-11-22 08:54:08 42→43
4 / ce6d3c39bd29463cbe8186227251c57f: 2026-05-18 01:06:01 43→44

I've attached 4 (see above)

Comment 9 John Dodson 2026-05-25 11:20:46 UTC
I think I used dnf5

I wrote a script (usr/local/[s]bin/dnf on Dec 11  2024) to restrict dnf to root &
check the "link to be used " is to dnf5 after previous problems.

Comment 10 John Dodson 2026-05-25 11:21:38 UTC
Oh & yes, the dnf5 used would have been the FC43 version.

Comment 11 Petr Pisar 2026-05-25 12:14:45 UTC
According to the log, it was indeed DNF5.

The log at the beginning correctly displays repositories of the upgraded packages and everything looks fine. But at the end it shows:

  May 18 11:22:47 localhost dnf5[825]: [6991/6991] Removing libgcc-0:15.2.1-7. 100% |   0.0   B/s |  11.0   B |  03m35s
  May 18 11:22:47 localhost dnf5[825]: Transaction failed: Rpm transaction failed.

That explains why DNF5 did not record the upgraded packages to its database: RPM library reported a failure and thus DNF5 expected that the packages were not upgraded. RPM library usually rollbacks the change. But not always. Especially when the error happens late in the transaction like here. The system is in general in an undefined state in that case.

I could not find any other error. There is only:

  May 18 11:09:07 localhost dnf5[825]: >>> Running %post scriptlet: syslinux-extlinux-0:6.04-0.35.fc44.x86_64
  May 18 11:09:07 localhost dnf5[825]: >>> Non-critical error in %post scriptlet: syslinux-extlinux-0:6.04-0.35.fc44.x8

and the transaction continued as expected.

DNF5 should record upgraded (installed) packages that survived a transaction failure. That's a bug in DNF5 in Transaction::Impl::_run() in libdnf5/base/transaction.cpp:

    // execute rpm transaction
    ret = rpm_transaction.run();

    [...]
    // TODO(mblaha): Handle ret == -1 and ret > 0, fill problems list

    if (ret == 0) {
       // set the new system state
   
But why the transaction failed, I cannot tell. Maybe one of the /var/log/dnf5.log* files could have more details, unless already rotated.

Comment 12 John Dodson 2026-05-25 13:00:49 UTC
I think this is the error in the log (I keep logs for a while)...

2026-05-18T01:09:07+0000 [825] INFO RPM callback open file "/usr/lib/sysimage/libdnf5/offline/./packages/syslinux-extlinux-6.04-0.35.fc44.
x86_64.rpm"
2026-05-18T01:09:07+0000 [825] INFO RPM callback install start "syslinux-extlinux-0:6.04-0.35.fc44.x86_64" total 211856
2026-05-18T01:09:07+0000 [825] INFO RPM callback install stop "syslinux-extlinux-0:6.04-0.35.fc44.x86_64" amount 211856 total 211856
2026-05-18T01:09:07+0000 [825] INFO RPM callback start %triggerin scriptlet "filesystem-0:3.18-52.fc44.x86_64"
2026-05-18T01:09:07+0000 [825] INFO RPM callback stop %triggerin scriptlet "filesystem-0:3.18-52.fc44.x86_64" return code 0
2026-05-18T01:09:07+0000 [825] INFO RPM callback start %post scriptlet "syslinux-extlinux-0:6.04-0.35.fc44.x86_64"
2026-05-18T01:09:07+0000 [825] INFO [scriptlet] /boot/extlinux is device /dev/sda1
2026-05-18T01:09:07+0000 [825] INFO [scriptlet] extlinux: no previous syslinux boot sector found
2026-05-18T01:09:07+0000 [825] WARNING [rpm] %post(syslinux-extlinux-6.04-0.35.fc44.x86_64) scriptlet failed, exit status 1
2026-05-18T01:09:07+0000 [825] INFO RPM callback stop %post scriptlet "syslinux-extlinux-0:6.04-0.35.fc44.x86_64" return code 1
2026-05-18T01:09:07+0000 [825] WARNING RPM callback non-critical error in %post scriptlet "syslinux-extlinux-0:6.04-0.35.fc44.x86_64"
2026-05-18T01:09:07+0000 [825] INFO RPM callback close file

Comment 13 John Dodson 2026-05-25 13:02:42 UTC
Boot is with grub as far as I'm aware.

Comment 14 Petr Pisar 2026-05-25 13:45:12 UTC
Good catch. I reported it against syslinux (bug #2481186).

I recommend you uninstalling the package, or removing its configuration file (/boot/extlinux/extlinux.conf and /boot/extlinux.conf) until syslinux maintainer fixes the package.

Comment 15 John Dodson 2026-05-26 03:16:20 UTC
OK thanks. 

Further on the "unknown" problem, if I give these commands on any of my FC44 machines
today...

# grep unknown  /usr/lib/sysimage/libdnf5/nevras.toml |wc -l
0
# dnf -q list --installed|grep unknown|wc -l
2399

So the "unknown" entries have gone from /usr/lib/sysimage/libdnf5/nevras.toml
but dnf -q list still sees them.
That means I can't just edit /usr/lib/sysimage/libdnf5/nevras.toml

I have to ask is /usr/lib/sysimage/libdnf5/nevras.toml really "accurate"?
I also notice that it is "missing" an item (package) that really is unknown
ie. I install it manually - I think it was in /usr/lib/sysimage/libdnf5/nevras.toml
previously, but not now.

# dnf list dnf*
Updating and loading repositories:
Repositories loaded.
Installed packages (available for reinstall, available for upgrade)
dnf-data.noarch                 4.24.0-3.fc44                       fedora
dnf-plugins-core.noarch         4.10.1-9.fc44                       fedora
dnf-utils.noarch                4.10.1-9.fc44                       fedora
dnf5.x86_64                     5.4.2.1-1.fc44                      updates
dnf5-plugin-automatic.x86_64    5.4.2.1-1.fc44                      updates
dnf5-plugins.x86_64             5.4.2.1-1.fc44                      updates
dnf5daemon-server.x86_64        5.4.2.1-1.fc44                      updates
dnf5daemon-server-polkit.noarch 5.4.2.1-1.fc44                      updates



Additionally, today, now I'm a little more watchful of errors, I see this during
a "dnf update"

>>> Running %posttrans scriptlet: memtest86+-0:8.10-1.fc44.x86_64
>>> Finished %posttrans scriptlet: memtest86+-0:8.10-1.fc44.x86_64
>>> Scriptlet output:
>>> /usr/lib64/memtest86+/memtest86+.kernel-install-plugin succeeded with exit status 77, not executing remaining executables.


that's more than a few set bits that I assume represent individual problems.
OR... Maybe use of exit status bits have changed since the 1980's ;-)

Sorry to be a pest :-)

Comment 16 John Dodson 2026-05-26 03:16:56 UTC
BTW - the above is now all on FC44

Comment 17 Petr Pisar 2026-05-26 12:28:03 UTC
/usr/lib/sysimage/libdnf5/nevras.toml lists specific package versions. Those installed by DNF5 from a repository have a repository name there. Those installed by DNF5 from a local package file have "@commandline" there. Those install with a different tool have no entry there. The only exception is when /usr/lib/sysimage/libdnf5/nevras.toml does not exist. Then the data are imported from DNF4 database, if the database exists.

If "dnf list" does not find a package version in /usr/lib/sysimage/libdnf5/nevras.toml, it will print "unknown".

That's what happens to you: The newly installed package versions were not written into that file because RPM reported a failure in the transaction. Therefore the file does not contain "unknown" string, but "dnf list" prints "unknown" for them.


>>> Running %posttrans scriptlet: memtest86+-0:8.10-1.fc44.x86_64
>>> Finished %posttrans scriptlet: memtest86+-0:8.10-1.fc44.x86_64
>>> Scriptlet output:
>>> /usr/lib64/memtest86+/memtest86+.kernel-install-plugin succeeded with exit status 77, not executing remaining executables.

You can talk about this message with memtest86+ maintainers.

Comment 18 John Dodson 2026-05-27 03:13:43 UTC
I am sure on the first machine I upgraded the /usr/lib/sysimage/libdnf5/nevras.toml contained "unknown" entries
after that upgrade.

Sadly I didn't keep a copy.

So it seems my "dnf state" is somehow corrupt...
 
Here is the current "state", let's just worry about the first say 15 packages...

# dnf -q list --installed |head -16
Installed packages
7zip.x86_64                                          25.01-5.fc44                        <unknown>
Box2D.x86_64                                         2.4.2-7.fc44                        <unknown>
CharLS.x86_64                                        2.4.3-2.fc44                        <unknown>
GConf2.x86_64                                        3.2.6-49.fc44                       <unknown>
GeoIP.x86_64                                         1.6.12-23.fc44                      <unknown>
GeoIP-GeoLite-data.noarch                            2018.06-21.fc44                     <unknown>
GraphicsMagick.x86_64                                1.3.45-7.fc44                       fedora
ImageMagick.x86_64                                   1:7.1.2.13-2.fc44                   fedora
ImageMagick-c++.x86_64                               1:7.1.2.13-2.fc44                   fedora
ImageMagick-doc.x86_64                               1:7.1.2.13-2.fc44                   fedora
ImageMagick-libs.x86_64                              1:7.1.2.13-2.fc44                   fedora
ImageMagick-perl.x86_64                              1:7.1.2.13-2.fc44                   fedora
InsightToolkit.x86_64                                4.13.3-32.fc44                      <unknown>
LibRaw.x86_64                                        0.22.1-1.fc44                       <unknown>

Then... (Why 25? you'll see ;-)

# head -25 /usr/lib/sysimage/libdnf5/nevras.toml
version = "1.0"

[nevras]
"7zip-25.01-1.fc43.x86_64" = {from_repo = "updates"}
"Box2D-2.4.2-5.fc43.x86_64" = {from_repo = "fedora"}
"CharLS-2.4.3-2.fc43.x86_64" = {from_repo = "updates"}
"GConf2-3.2.6-47.fc43.x86_64" = {from_repo = "fedora"}
"GeoIP-1.6.12-21.fc43.x86_64" = {from_repo = "fedora"}
"GeoIP-GeoLite-data-2018.06-19.fc43.noarch" = {from_repo = "fedora"}
"GraphicsMagick-1.3.45-5.fc43.x86_64" = {from_repo = "fedora"}
"GraphicsMagick-1.3.45-7.fc44.x86_64" = {from_repo = "fedora"}
"ImageMagick-1:7.1.1.47-3.fc43.x86_64" = {from_repo = "fedora"}
"ImageMagick-1:7.1.2.13-2.fc44.x86_64" = {from_repo = "fedora"}
"ImageMagick-c++-1:7.1.1.47-3.fc43.x86_64" = {from_repo = "fedora"}
"ImageMagick-c++-1:7.1.2.13-2.fc44.x86_64" = {from_repo = "fedora"}
"ImageMagick-doc-1:7.1.1.47-3.fc43.x86_64" = {from_repo = "fedora"}
"ImageMagick-doc-1:7.1.2.13-2.fc44.x86_64" = {from_repo = "fedora"}
"ImageMagick-libs-1:7.1.1.47-3.fc43.x86_64" = {from_repo = "fedora"}
"ImageMagick-libs-1:7.1.2.13-2.fc44.x86_64" = {from_repo = "fedora"}
"ImageMagick-perl-1:7.1.1.47-3.fc43.x86_64" = {from_repo = "fedora"}
"ImageMagick-perl-1:7.1.2.13-2.fc44.x86_64" = {from_repo = "fedora"}
"InsightToolkit-4.13.3-32.fc43.x86_64" = {from_repo = "updates"}
"LibRaw-0.21.5-1.fc43.x86_64" = {from_repo = "updates"}

Note that nevras still thinks we have fc43 versions installed, "dnf" does not!

If nevras is so critical to the dnf state then we need a way of recovering it to
a "valid state".

I currently seem to have 3 machines on fc44 where nevras thinks they have bits of fc43.

OK it was an error, but how can I recover?

If I try,
# dnf reinstall 7zip
Updating and loading repositories:
Repositories loaded.
Package                  Arch    Version                  Repository        Size
Reinstalling:
 7zip                    x86_64  0:25.01-5.fc44           fedora         3.3 MiB
   replacing 7zip        x86_64  0:25.01-5.fc44           <unknown>      3.3 MiB

Transaction Summary:
 Reinstalling:       1 package
 Replacing:          1 package

Total size of inbound packages is 1 MiB. Need to download 1 MiB.
After this operation, 0 B extra will be used (install 3 MiB, remove 3 MiB).
Is this ok [y/N]: y
[1/1] 7zip-0:25.01-5.fc44.x86_64        100% | 782.1 KiB/s |   1.3 MiB |  00m02s
--------------------------------------------------------------------------------
[1/1] Total                             100% | 407.0 KiB/s |   1.3 MiB |  00m03s
Running transaction
[1/4] Verify package files              100% |  83.0   B/s |   1.0   B |  00m00s
[2/4] Prepare transaction               100% |   5.0   B/s |   2.0   B |  00m00s
[3/4] Reinstalling 7zip-0:25.01-5.fc44. 100% |  90.3 MiB/s |   3.3 MiB |  00m00s
[4/4] Removing 7zip-0:25.01-5.fc44.x86_ 100% |  29.0   B/s |  16.0   B |  00m01s
Complete!

# dnf list 7zip
Updating and loading repositories:
Repositories loaded.
Installed packages (available for reinstall, available for upgrade)
7zip.x86_64 25.01-5.fc44 fedora

# head -5 /usr/lib/sysimage/libdnf5/nevras.toml
version = "1.0"

[nevras]
"7zip-25.01-1.fc43.x86_64" = {from_repo = "updates"}
"7zip-25.01-5.fc44.x86_64" = {from_repo = "fedora"}

Is what nevras now says, so it gets worse!

# dnf remove 7zip-25.01-1*
No packages to remove for argument: 7zip-25.01-1*

Nothing to do.

Note that I have reinstalled some packages & it seems to fix what "dnf -q list --installed" reports,
but it seems that under the hood dnf's idea of the state is actually getting worse.


One more question... is there a really valid reason why the package names have different formats in
different locations?

eg.
        7zip.x86_64 25.01-5.fc44
vs
        7zip-25.01-5.fc44.x86_64"

Can't we have more consistency?

Comment 19 Petr Pisar 2026-05-27 07:32:24 UTC
> Note that nevras still thinks we have fc43 versions installed, "dnf" does not!

Because as I said you that file was not updated when your upgrade failed.

However, you have a wrong assumption that the file is a source of installed packages. It isn't. The source is an RPM database (rpm -qa). That file only records where given package version was installed from. It's so because RPM does not maintain this kind of information, so it is maintained by DNF5.

Comment 20 John Dodson 2026-05-27 11:55:12 UTC
So how do we fix a bad "dnf5 state"? (as recorded in the nevras file?)

Comment 21 Petr Pisar 2026-05-27 12:01:20 UTC
The state will be fixed when the package is updated. It's only cosmetic flaw. The repository origin is not used for anything.

Comment 22 John Dodson 2026-05-27 12:03:38 UTC
So nevras.toml is wrong & dnf gets data from it to display "dnf list" which is also wrong
but not what is recorded in nevras.toml

I really didn't want to ask this...

Where is the dnf code base now?

Comment 23 John Dodson 2026-05-27 12:19:26 UTC
It's obviously fixed in nevras when the package is reinstalled.

I've never liked cosmetics.

Having unknown in lots of packages means I can't track real "unknown"
packages so it might be cosmetic, but I now have a lot of it that I really
don't like & want to correct.

dnf5 is obviously not getting the "package version was installed from" data from the nevras file,
it mostly says "updates".
So where is it coming from? When the nevras file now appears to be right? (except for some fc43-isms
seemingly caused by resinstalls)


Do I have to reinstall everything that appears as unknown?

Comment 24 John Dodson 2026-05-30 21:59:24 UTC
Assuming I do have to "reinstall" everything, I'm gradually doing so...

Here's another discovery...

>>> Running %posttrans scriptlet: systemd-udev-0:259.5-1.fc44.x86_64
>>> Finished %posttrans scriptlet: systemd-udev-0:259.5-1.fc44.x86_64
>>> Scriptlet output:
>>> Failed to set unit properties on systemd-oomd.service: Unit systemd-oomd.service is masked.
>>> 

Yes, I mask systemd-oomd.
So what effect did this have on dnf doing it's job & keeping whatever databases it uses up to date?

Comment 25 John Dodson 2026-05-30 22:55:01 UTC
FYI...

grep fc43 /usr/lib/sysimage/libdnf5/nevras.toml|wc -l
3469
wc -l /usr/lib/sysimage/libdnf5/nevras.toml
5072

Comment 26 John Dodson 2026-05-30 22:56:28 UTC
dnf list --installed |grep fc43|wc -l
18

Comment 27 Aoife Moloney 2026-11-10 19:46:15 UTC
This message is a reminder that Fedora Linux 43 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 43 on 2026-12-02.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '43'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 43 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.


Note You need to log in before you can comment on or make changes to this bug.