Run dnf remove --duplicates but received Unknown argument "--duplicates"

You can achieve the same result with this command:

sudo dnf reinstall $(dnf rq --duplicates \
    --latest-limit=1 --qf="%{name}\n")

See also:
Upgrade to 41, "dnf remove --oldinstallonly" doesn't work in dnf5 - #3 by vgaetera

3 Likes