Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at
Bug 1899852 - repomanage is broken, reports not existing packages
Summary: repomanage is broken, reports not existing packages
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf-plugins-core
Version: 33
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: amatej
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2020-11-20 09:01 UTC by Remi Collet
Modified: 2021-05-03 01:48 UTC (History)
9 users (show)

Fixed In Version: dnf-plugins-core-4.0.21-1.fc33
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2021-05-03 01:48:14 UTC
Type: Bug

Attachments (Terms of Use)

Description Remi Collet 2020-11-20 09:01:09 UTC
Was working fine in F31 (version 4.0.18-1)

Is broken in F33 (version 4.0.18-1)

Playing with my repository, ex
Were I keep 8 versions of each package, and also 8 versions of the metadata

$ dnf repomanage --keep 8 --old .
Added repomanage_repo repo from .

These packages don't exist (but are probably referenced in some old metadata)

So looks like repomanage is not reading the proper data.

Comment 1 Remi Collet 2020-11-20 09:02:57 UTC
Side effects, some packages are not reported so are not removed... thus more than 8 versions exist in the repo

Comment 2 amatej 2020-11-23 07:50:37 UTC
In order to support modular repositories repomanage now has to use the present repodata, but I made an error while adding this functionality which causes repomanage to use old (cached) repodata when running it multiple times. 

So in your case its possible it keeps using some old version of the metadata that still has the deleted packages. Can you please try running repomanage with option --setopt=metadata_expire=1 as a workaround to see if this fixes your problem?

Comment 3 Remi Collet 2020-11-23 08:05:43 UTC
$ dnf repomanage --keep 8 --old . --setopt=metadata_expire=1
Ajout du dépôt repomanage_repo depuis le .

So, yes, this seems to work as expected.

Comment 4 Remi Collet 2020-11-23 08:08:07 UTC
> In order to support modular repositories repomanage now has to use the present repodata

Does that mean, repomanage have to be run "after" a createrepo ?

Old process was

- repomanage
- createrepo

Do I have to

- createrepo
- repomanage
- createrepo

Comment 5 Remi Collet 2020-11-23 08:27:13 UTC
From a new test it seems that process have change as described in my previous comment...

Comment 6 amatej 2020-11-23 08:31:45 UTC
Here is a PR to fix the mentioned bug with caching:
and a test:

> Does that mean, repomanage have to be run "after" a createrepo ?

It depends, but if you have old out of date repodata present (meaning you added/removed rpms since last run of createrepo) then yes, you have to either update the repodata (running createrepo) or remove them (modules won't work).

Comment 7 Remi Collet 2020-11-23 08:53:50 UTC
Thanks for your effort, but looks like this command doesn't suit my needs anymore.

Switching to a small PHP script doing the work instead

Comment 8 Fedora Update System 2021-04-19 16:12:43 UTC
FEDORA-2021-447fb19490 has been submitted as an update to Fedora 33.

Comment 9 Fedora Update System 2021-04-19 18:33:36 UTC
FEDORA-2021-447fb19490 has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-447fb19490`
You can provide feedback for this update here:

See also for more information on how to test updates.

Comment 10 Fedora Update System 2021-05-03 01:48:14 UTC
FEDORA-2021-447fb19490 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.

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