我正在使用Archlinux。最近更新后,我发现 gdbus 无法工作,并且出现符号查找错误:
➜ tidedra@ZgrArch ~ gdbus
gdbus: symbol lookup error: /usr/lib/libgobject-2.0.so.0: undefined symbol: g_string_free_and_steal
然后我想可能是库版本的问题,于是检查了相关文件的链接库:
➜ tidedra@ZgrArch ~ ldd /usr/bin/gdbus
linux-vdso.so.1 (0x00007ffd17dd7000)
libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0 (0x00007f6b395eb000)
libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007f6b394a0000)
libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x00007f6b3943f000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f6b39258000)
libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x00007f6b39251000)
libz.so.1 => /usr/lib/libz.so.1 (0x00007f6b39237000)
libmount.so.1 => /usr/lib/libmount.so.1 (0x00007f6b391f1000)
libpcre2-8.so.0 => /usr/lib/libpcre2-8.so.0 (0x00007f6b39156000)
libffi.so.8 => /usr/lib/libffi.so.8 (0x00007f6b3914b000)
/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f6b397f9000)
libblkid.so.1 => /usr/lib/libblkid.so.1 (0x00007f6b39113000)
➜ tidedra@ZgrArch ~ ls -il /usr/lib/libgobject-2.0.so*
1195587 lrwxrwxrwx 1 root root 19 3月10日 23:18 /usr/lib/libgobject-2.0.so -> libgobject-2.0.so.0
1195588 lrwxrwxrwx 1 root root 35 3月14日 18:48 /usr/lib/libgobject-2.0.so.0 -> /usr/lib/libgobject-2.0.so.0.7600.0
1195589 -rwxr-xr-x 1 root root 391208 3月10日 23:18 /usr/lib/libgobject-2.0.so.0.7600.0
➜ tidedra@ZgrArch ~ ls -il /usr/lib/libglib-2.0.so*
1195561 lrwxrwxrwx 1 root root 16 3月10日 23:18 /usr/lib/libglib-2.0.so -> libglib-2.0.so.0
1198392 lrwxrwxrwx 1 root root 32 3月14日 18:44 /usr/lib/libglib-2.0.so.0 -> /usr/lib/libglib-2.0.so.0.7600.0
1195573 -rwxr-xr-x 1 root root 1351064 3月10日 23:18 /usr/lib/libglib-2.0.so.0.7600.0
➜ tidedra@ZgrArch ~ sudo updatedb
➜ tidedra@ZgrArch ~ locate libgobject
/home/tidedra/.conda/pkgs/glib-2.69.1-he621ea3_2/lib/libgobject-2.0.so
/home/tidedra/.conda/pkgs/glib-2.69.1-he621ea3_2/lib/libgobject-2.0.so.0
/home/tidedra/.conda/pkgs/glib-2.69.1-he621ea3_2/lib/libgobject-2.0.so.0.6901.0
/opt/miniconda3/lib/libgobject-2.0.so
/opt/miniconda3/lib/libgobject-2.0.so.0
/opt/miniconda3/lib/libgobject-2.0.so.0.6901.0
/opt/miniconda3/pkgs/glib-2.69.1-h4ff587b_1/lib/libgobject-2.0.so
/opt/miniconda3/pkgs/glib-2.69.1-h4ff587b_1/lib/libgobject-2.0.so.0
/opt/miniconda3/pkgs/glib-2.69.1-h4ff587b_1/lib/libgobject-2.0.so.0.6901.0
/opt/miniconda3/pkgs/glib-2.69.1-he621ea3_2/lib/libgobject-2.0.so
/opt/miniconda3/pkgs/glib-2.69.1-he621ea3_2/lib/libgobject-2.0.so.0
/opt/miniconda3/pkgs/glib-2.69.1-he621ea3_2/lib/libgobject-2.0.so.0.6901.0
/usr/lib/libgobject-2.0.a
/usr/lib/libgobject-2.0.so
/usr/lib/libgobject-2.0.so.0
/usr/lib/libgobject-2.0.so.0.7600.0
/usr/lib32/libgobject-2.0.so
/usr/lib32/libgobject-2.0.so.0
/usr/lib32/libgobject-2.0.so.0.7600.0
/usr/share/gdb/auto-load/usr/lib/libgobject-2.0.so.0.7600.0-gdb.py
➜ tidedra@ZgrArch ~ locate libglib-2.0
/home/tidedra/.conda/pkgs/glib-2.69.1-he621ea3_2/lib/libglib-2.0.so
/home/tidedra/.conda/pkgs/glib-2.69.1-he621ea3_2/lib/libglib-2.0.so.0
/home/tidedra/.conda/pkgs/glib-2.69.1-he621ea3_2/lib/libglib-2.0.so.0.6901.0
/opt/miniconda3/lib/libglib-2.0.so
/opt/miniconda3/lib/libglib-2.0.so.0
/opt/miniconda3/lib/libglib-2.0.so.0.6901.0
/opt/miniconda3/pkgs/glib-2.69.1-h4ff587b_1/lib/libglib-2.0.so
/opt/miniconda3/pkgs/glib-2.69.1-h4ff587b_1/lib/libglib-2.0.so.0
/opt/miniconda3/pkgs/glib-2.69.1-h4ff587b_1/lib/libglib-2.0.so.0.6901.0
/opt/miniconda3/pkgs/glib-2.69.1-he621ea3_2/lib/libglib-2.0.so
/opt/miniconda3/pkgs/glib-2.69.1-he621ea3_2/lib/libglib-2.0.so.0
/opt/miniconda3/pkgs/glib-2.69.1-he621ea3_2/lib/libglib-2.0.so.0.6901.0
/usr/lib/libglib-2.0.a
/usr/lib/libglib-2.0.so
/usr/lib/libglib-2.0.so.0
/usr/lib/libglib-2.0.so.0.7600.0
/usr/lib32/libglib-2.0.so
/usr/lib32/libglib-2.0.so.0
/usr/lib32/libglib-2.0.so.0.7600.0
/usr/share/gdb/auto-load/usr/lib/libglib-2.0.so.0.7600.0-gdb.py
我没有发现任何问题,只有7600版本,除了miniconda中的6901版本,我认为与此错误无关。那么我的 gdbus 有什么问题吗?
答案1
我知道出了什么问题。我检查了我的PATH
,发现/opt/miniconda/bin
是 before /usr/bin
,这意味着当我gdbus
在终端调用时,它/opt/miniconda/bin/gdbus
实际调用,而不是/usr/bin/gdbus
,并且正如你所看到的,miniconda gdbus 的某些链接库的版本与其他库的版本不一致。所以我删除了miniconda中的路径PATH
,或者你可以让miniconda不从终端启动,那么问题就解决了。
答案2
此问题似乎与内核 6.2.0.arch1-1 有关。我已经降级到内核 6.1.12-arch1-1,并且似乎不再遇到相关问题。就我而言,当前内核甚至与网络管理器发生冲突并导致终端中的所有内容崩溃