Fix SQLite3 dependency issue for dnf

Recently when I did a dnf update I saw broken package for sqlite on my Fedora 23. Then I attempt to re-install that by removing it.

rpm -e --nodeps sqlite

Then shit hit the fan.

When I then try to run rpm or dnf, both giving me errors.

dnf gave me:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python3.4/sqlite3/__init__.py", line 24, in 
    from dbapi2 import *
  File "/usr/lib64/python3.4/sqlite3/dbapi2.py", line 27, in 
    from _sqlite3 import *
ImportError: File not found

And RPM gave me this error:

error: Failed to initialize NSS library

So rpm and dnf could not install packages. With a little searching around, I eventually figure out a way.

Step 1: Download sqlite3 from https://www.sqlite.org/download.html
Download the autoconf version of sqlite3 source code.

Step 2: compile. You need gcc and other tools. You better have this before this incident!

./configure && make

Step 3: Install those libs to /usr/local/lib

make install

Step 4:Using DNF to install.

LD_LIBRARY_PATH=/usr/local/lib dnf --best install sqlite

Should work.

Leave a comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.