运行 apt update 时 sqllite3 出错

运行 apt update 时 sqllite3 出错

我在使用 Ubuntu 24.04。

当我运行时,sudo apt update我收到以下错误输出:

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_extension
Reading package lists... Done

E: 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


运行时:

ldd /usr/lib/python3.12/lib-dynload/_sqlite3.cpython-312-x86_64-linux-gnu.so

我的输出是这样的:

linux-vdso.so.1 (0x00007ffc32f1e000)
    libsqlite3.so.0 => /usr/local/lib/libsqlite3.so.0 (0x00007db35d69a000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007db35d400000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007db35d67e000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007db35d317000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007db35d679000)
    /lib64/ld-linux-x86-64.so.2 (0x00007db35d802000)

正如你在这一行中看到的:

libsqlite3.so.0 => /usr/local/lib/libsqlite3.so.0

apt update它是一个与尝试加载的库完全不同的库。

当我运行时,dpkg -L libsqlite3-0我的输出是:

/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6
/usr/share
/usr/share/doc
/usr/share/doc/libsqlite3-0
/usr/share/doc/libsqlite3-0/README.Debian
/usr/share/doc/libsqlite3-0/changelog.Debian.gz
/usr/share/doc/libsqlite3-0/copyright
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0

我不太擅长 Linux,不知道如何解决这个问题。如能提供任何详细的帮助,我将不胜感激。

相关内容