Libraries

“符號查找錯誤:/usr/lib/x86_64-linux-gnu/libxfconf-0.so.2:未定義符號:g_type_class_adjust_private_offset”

  • April 20, 2017

剛剛通過更改 sources.list 和 apt-get upgrade/dist-upgrade 的直接方法將我的開發系統從 Debian Wheezy 升級到 Debian Jessie。現在,當我嘗試登錄 xdm 時,我看到了失敗,並且從 apt-get 返回了錯誤。這是 .xsession-errors

Xsession: X session started for rosuav at Friday 22 May  02:23:12 AEST 2015
localuser:rosuav being added to access control list
GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
/usr/bin/x-session-manager: X server already running on display :0
xfce4-session: symbol lookup error: /usr/lib/x86_64-linux-gnu/libxfconf-0.so.2: undefined symbol: g_type_class_adjust_private_offset

當我執行一些 apt-get 命令時,我得到了這個:

Processing triggers for man-db (2.7.0.2-5) ...

(gdbus call:10631): GLib-GObject-CRITICAL **: gtype.c:2722: You forgot to call g_type_init()

(gdbus call:10631): GLib-GObject-CRITICAL **: gtype.c:2722: You forgot to call g_type_init()

(gdbus call:10631): GLib-GObject-CRITICAL **: g_type_interface_add_prerequisite: assertion `G_TYPE_IS_INTERFACE (interface_type)' failed

(gdbus call:10631): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed

(gdbus call:10631): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(gdbus call:10631): GLib-GObject-CRITICAL **: gtype.c:2722: You forgot to call g_type_init()

(gdbus call:10631): GLib-GObject-CRITICAL **: g_type_interface_add_prerequisite: assertion `G_TYPE_IS_INTERFACE (interface_type)' failed

(gdbus call:10631): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed

(gdbus call:10631): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(gdbus call:10631): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed

(gdbus call:10631): GLib-GObject-CRITICAL **: g_object_new: assertion `G_TYPE_IS_OBJECT (object_type)' failed
**
GLib-GIO:ERROR:gdbusconnection.c:6764:get_uninitialized_connection: assertion failed: (ret != NULL)
Aborted

它似乎只發生在“處理…的觸發器”之後,但是處理哪些包的觸發器會有所不同。可能是它正在處理其他東西的觸發器並且沒有這麼說。

與穀歌一起探索發現了一些看起來相似但沒有幫助的東西,通常是因為他們沒有答案。

萬一它很重要,自升級以來我一直在這個系統上遇到 GRUB 問題,並且必須手動設置一些參數並重新呼叫引導過程(從 grub-rescue 提示符)。我可能不得不簡單地給自己買一個新的硬碟驅動器,重新安裝,然後把所有東西都轉移過來……但我真的不想這樣做,主要是因為極客更喜歡真正知道發生了什麼:)

編輯:根據要求,這裡是ldd /usr/bin/xfce4-session

linux-vdso.so.1 (0x00007ffd85bdc000)
libxfsm-4.6.so.0 => /usr/lib/x86_64-linux-gnu/libxfsm-4.6.so.0 (0x00007f1bbb036000)
libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007f1bbae2e000)
libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007f1bbac10000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f1bba8cd000)
libxfce4ui-1.so.0 => /usr/lib/x86_64-linux-gnu/libxfce4ui-1.so.0 (0x00007f1bba6ba000)
libxfce4util.so.6 => /usr/lib/x86_64-linux-gnu/libxfce4util.so.6 (0x00007f1bba4aa000)
libgmodule-2.0.so.0 => /usr/local/lib/libgmodule-2.0.so.0 (0x00007f1bba2a7000)
libwnck-1.so.22 => /usr/lib/libwnck-1.so.22 (0x00007f1bba066000)
libgtk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 (0x00007f1bb9a17000)
libgdk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0 (0x00007f1bb9761000)
libatk-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007f1bb953a000)
libcairo.so.2 => /usr/lib/x86_64-linux-gnu/libcairo.so.2 (0x00007f1bb9224000)
libgdk_pixbuf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007f1bb9002000)
libpango-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007f1bb8db4000)
libpolkit-gobject-1.so.0 => /usr/lib/x86_64-linux-gnu/libpolkit-gobject-1.so.0 (0x00007f1bb8b97000)
libgio-2.0.so.0 => /usr/local/lib/libgio-2.0.so.0 (0x00007f1bb884f000)
libxfconf-0.so.2 => /usr/lib/x86_64-linux-gnu/libxfconf-0.so.2 (0x00007f1bb863b000)
libdbus-glib-1.so.2 => /usr/lib/x86_64-linux-gnu/libdbus-glib-1.so.2 (0x00007f1bb8413000)
libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f1bb81cb000)
libgobject-2.0.so.0 => /usr/local/lib/libgobject-2.0.so.0 (0x00007f1bb7f81000)
libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x00007f1bb7c64000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1bb7963000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1bb7746000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1bb739c000)
libpangocairo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007f1bb718f000)
libpangoft2-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007f1bb6f79000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f1bb6d3b000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f1bb6a90000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f1bb688a000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f1bb6668000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f1bb6464000)
libstartup-notification-1.so.0 => /usr/lib/x86_64-linux-gnu/libstartup-notification-1.so.0 (0x00007f1bb6259000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f1bb6051000)
libXRes.so.1 => /usr/lib/x86_64-linux-gnu/libXRes.so.1 (0x00007f1bb5e4d000)
libXcomposite.so.1 => /usr/lib/x86_64-linux-gnu/libXcomposite.so.1 (0x00007f1bb5c4a000)
libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f1bb5a46000)
libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f1bb5840000)
libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f1bb5636000)
libXinerama.so.1 => /usr/lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007f1bb5432000)
libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f1bb5222000)
libXrandr.so.2 => /usr/lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007f1bb5018000)
libXcursor.so.1 => /usr/lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007f1bb4e0c000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f1bb4bfa000)
libpixman-1.so.0 => /usr/lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007f1bb494c000)
libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f1bb4725000)
libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007f1bb4521000)
libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007f1bb4316000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f1bb40fb000)
libgthread-2.0.so.0 => /usr/local/lib/libgthread-2.0.so.0 (0x00007f1bb3ef9000)
libthai.so.0 => /usr/lib/x86_64-linux-gnu/libthai.so.0 (0x00007f1bb3cf0000)
libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007f1bb3acc000)
libffi.so.5 => /usr/lib/x86_64-linux-gnu/libffi.so.5 (0x00007f1bb38be000)
libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f1bb3699000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f1bb3482000)
/lib64/ld-linux-x86-64.so.2 (0x00007f1bbb49a000)
libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f1bb322a000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f1bb3001000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f1bb2dfc000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f1bb2bf7000)
libxcb-util.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-util.so.0 (0x00007f1bb29ef000)
libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f1bb27ec000)
libdatrie.so.1 => /usr/lib/x86_64-linux-gnu/libdatrie.so.1 (0x00007f1bb25e4000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f1bb23c0000)
libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f1bb20de000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f1bb1e70000)
libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f1bb1c53000)
libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f1bb1a41000)

並且ls -l /lib/*/libglib*

lrwxrwxrwx 1 root root      23 Nov 13  2014 /lib/i386-linux-gnu/libglib-2.0.so.0 -> libglib-2.0.so.0.4200.1
-rw-r--r-- 1 root root 1207192 Nov 13  2014 /lib/i386-linux-gnu/libglib-2.0.so.0.4200.1
lrwxrwxrwx 1 root root      23 Nov 12  2014 /lib/x86_64-linux-gnu/libglib-2.0.so.0 -> libglib-2.0.so.0.4200.1
-rw-r--r-- 1 root root 1107040 Nov 12  2014 /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1

我不知道我安裝了 libglib2.0-0:i386;它似乎是 wine:i386 的依賴項。sudo apt-get purge libglib2.0-0:i386因為這對我來說並不重要,所以我嘗試將其刪除(順序。

問題在這裡:

libgmodule-2.0.so.0 => /usr/local/lib/libgmodule-2.0.so.0 (0x00007f1bba2a7000)
libgio-2.0.so.0 => /usr/local/lib/libgio-2.0.so.0 (0x00007f1bb884f000)
libgobject-2.0.so.0 => /usr/local/lib/libgobject-2.0.so.0 (0x00007f1bb7f81000)
libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x00007f1bb7c64000)
libgthread-2.0.so.0 => /usr/local/lib/libgthread-2.0.so.0 (0x00007f1bb3ef9000)

任何 Debian 安裝都不會將這些庫包含在 中/usr/local,因為它違反了策略(因為它違反了有關目錄結構的FHS規範)。該包裹將被拒絕。您可能已經從安裝這些庫的源中安裝了一些東西,並且系統更喜歡它/usr/local/usr/lib因為它是ldconfig首選項。

刪除這些庫(或註釋掉/etc/ld.so.conf.d/libc.conf文件)以確保連結器不會嘗試使用它們。

引用自:https://unix.stackexchange.com/questions/204877