Description of problem: dnf --refresh upgrade fails with the following error. Version-Release number of selected component (if applicable): 4.11.1-2 How reproducible: Run dnf --refresh upgrade Steps to Reproduce: 1. Install Fedora Workstation 35 2. Upgrade to Fedora Workstation 36 Beta 3. Run dnf --refresh upgrade Actual results: The downloaded packages were saved in cache until the next successful transaction. You can remove cached packages by executing 'dnf clean packages'. Error: SQLite error on "/var/lib/dnf/history.sqlite": Reading a row failed: UNIQUE constraint failed: rpm.name, rpm.epoch, rpm.version, rpm.release, rpm.arch Expected results: Running dnf --refresh upgrade succeeds.
Hello, apologies for the inconvenience. We're getting these reports quite rarely, they are nondeterministic (unless you can reproduce this, a reproducer would be very helpful to us) and we don't know the cause. You can remove (or, better, back up and remove) the /var/lib/dnf/history.sqlite file, dnf will keep working but you'll lose your userinstalled / groupinstalled packages, meaning dnf will no longer know which packages you installed explicitly and which were pulled in as a dependency. You can also attempt to repair the corrupted database following these steps (under root, you may need to install the sqlite3 binary via `dnf install -y sqlite`): # cd /var/lib/dnf # ls history.sqlite history.sqlite-shm history.sqlite-wal repos # mkdir db-backup # mv history.sqlite* db-backup # echo .recover | sqlite3 db-backup/history.sqlite > recover.sql # sqlite3 history.sqlite < recover.sql I'm marking this as a duplicate as we already have a bug for this. *** This bug has been marked as a duplicate of bug 1868860 ***