When I'm trying to run sudo apt update
, it fails to load the python sqlite package
sudo apt updateHit:1 http://download.opensuse.org/repositories/home:/manuelschneid3r/xUbuntu_24.04 InReleaseHit:2 https://downloads.1password.com/linux/debian/amd64 stable InRelease Hit:3 https://brave-browser-apt-release.s3.brave.com stable InRelease Hit:4 http://de.archive.ubuntu.com/ubuntu noble InRelease Hit:5 http://de.archive.ubuntu.com/ubuntu noble-updates InRelease Hit:6 http://de.archive.ubuntu.com/ubuntu noble-backports InRelease Hit:7 http://security.ubuntu.com/ubuntu noble-security InRelease Traceback (most recent call last): File "/usr/lib/cnf-update-db", line 9, in <module> from CommandNotFound.db.creator import DbCreator File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 7, in <module> import sqlite3 File "/usr/lib/python3.12/sqlite3/__init__.py", line 57, in <module> from sqlite3.dbapi2 import * File "/usr/lib/python3.12/sqlite3/dbapi2.py", line 27, in <module> from _sqlite3 import *ImportError: /usr/lib/python3.12/lib-dynload/_sqlite3.cpython-312-x86_64-linux-gnu.so: undefined symbol: sqlite3_enable_load_extensionReading package lists... DoneE: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'E: Sub-process returned an error code
I also tried to google it and found a solution, but somehow it didn't work!No module named _sqlite3By reinstalling python by building from source. It came out this error:
/usr/bin/install -c -m 755 Modules/_multiprocessing.cpython-312-x86_64-linux-gnu.so /usr/local/lib/python3.12/lib-dynload/_multiprocessing.cpython-312-x86_64-linux-gnu.so/usr/bin/install -c -m 755 Modules/_sqlite3.cpython-312-x86_64-linux-gnu.so /usr/local/lib/python3.12/lib-dynload/_sqlite3.cpython-312-x86_64-linux-gnu.so/usr/bin/install: cannot stat 'Modules/_sqlite3.cpython-312-x86_64-linux-gnu.so': No such file or directorymake: *** [Makefile:2066: sharedinstall] Error 1
And the installation just stops.
[ERROR] _sqlite3 failed to import: /home/thinh/Downloads/Python-3.12.4/build/lib.linux-x86_64-3.12/_sqlite3.cpython-312-x86_64-linux-gnu.so: undefined symbol: sqlite3_enable_load_extensionThe necessary bits to build these optional modules were not found:_bz2 _ctypes _ctypes_test _curses _curses_panel _dbm _gdbm _lzma _tkinter _uuid nis readline