Debian
在 debian 6 上損壞的 libglib
所以,前段時間我想將 mpd 從 1.5 更新到 1.6,這需要 amd64 上更新版本的 libglib(> = 2.31.8),所以我從原始碼編譯它們,因為我在 debian oldstable 上找不到更簡單的這樣做的方式。由於種種原因,直到現在我才再次訪問該系統。當我嘗試執行 mpd 時,它給了我以下錯誤:
mpd/usr/bin/mpd: symbol lookup error: /usr/bin/mpd: undefined symbol: g_malloc_n failed!
我嘗試重新安裝 mpd 但沒有結果,所以這次我嘗試從包管理器安裝舊的 libglib。安裝並沒有做太多,因為它報告 libglib 是最新版本,然後當它嘗試安裝一些其他軟體包(例如 libglib2.0-dev 或 libglib2.0-doc)時,它未能給出以下錯誤:
* Installing 1 assembly from libglib2.0-cil into Mono /usr/bin/mono: symbol lookup error: /usr/bin/mono: undefined symbol: g_malloc0_n Use of uninitialized value $_ in scalar chomp at /usr/share/cli-common/runtimes.d/mono line 144. Use of uninitialized value $fullname in concatenation (.) or string at /usr/share/cli-common/runtimes.d/mono line 113. /usr/bin/mono: symbol lookup error: /usr/bin/mono: undefined symbol: g_malloc0_n
然後我用 apt-get –reinstall libglib2.0 試試運氣,輸出是這樣的:
Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'libglib2.0-0' for regex 'libglib2.0' Note, selecting 'libglib2.0-dev' for regex 'libglib2.0' Note, selecting 'libglib2.0-doc' for regex 'libglib2.0' Note, selecting 'libglib2.0-cil' for regex 'libglib2.0' Note, selecting 'libglib2.0-0-dbg' for regex 'libglib2.0' Note, selecting 'libglib2.0-dbg' for regex 'libglib2.0' Note, selecting 'libglib2.0-0-refdbg' for regex 'libglib2.0' Note, selecting 'libglib2.0-data' for regex 'libglib2.0' Note, selecting 'libglib2.0-cil-dev' for regex 'libglib2.0' 0 upgraded, 0 newly installed, 8 reinstalled, 0 to remove and 0 not upgraded. 7 not fully installed or removed. Need to get 0 B/6,964 kB of archives. After this operation, 0 B of additional disk space will be used. (Reading database ... 55452 files and directories currently installed.) Preparing to replace libglib2.0-0 2.24.2-1 (using .../libglib2.0-0_2.24.2-1_amd64.deb) ... Unpacking replacement libglib2.0-0 ... Preparing to replace libglib2.0-data 2.24.2-1 (using .../libglib2.0-data_2.24.2-1_all.deb) ... Unpacking replacement libglib2.0-data ... Preparing to replace libglib2.0-dev 2.24.2-1 (using .../libglib2.0-dev_2.24.2-1_amd64.deb) ... Unpacking replacement libglib2.0-dev ... Preparing to replace libglib2.0-doc 2.24.2-1 (using .../libglib2.0-doc_2.24.2-1_all.deb) ... Unpacking replacement libglib2.0-doc ... Preparing to replace libglib2.0-0-dbg 2.24.2-1 (using .../libglib2.0-0-dbg_2.24.2-1_amd64.deb) ... Unpacking replacement libglib2.0-0-dbg ... Preparing to replace libglib2.0-0-refdbg 2.24.2-1 (using .../libglib2.0-0-refdbg_2.24.2-1_amd64.deb) ... Unpacking replacement libglib2.0-0-refdbg ... Setting up mono-gac (2.6.7-5.1) ... * Installing 1 assembly from libglib2.0-cil into Mono /usr/bin/mono: symbol lookup error: /usr/bin/mono: undefined symbol: g_malloc0_n Use of uninitialized value $_ in scalar chomp at /usr/share/cli-common/runtimes.d/mono line 144. Use of uninitialized value $fullname in concatenation (.) or string at /usr/share/cli-common/runtimes.d/mono line 113. /usr/bin/mono: symbol lookup error: /usr/bin/mono: undefined symbol: g_malloc0_n E: installing Assembly /usr/lib/cli/glib-sharp-2.0/glib-sharp.dll failed E: Installation of libglib2.0-cil with /usr/share/cli-common/runtimes.d/mono failed dpkg: error processing mono-gac (--configure): subprocess installed post-installation script returned error exit status 9 configured to not write apport reports dpkg: dependency problems prevent configuration of mono-runtime: mono-runtime depends on mono-gac (= 2.6.7-5.1); however: Package mono-gac is not configured yet. dpkg: error processing mono-runtime (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libmono-corlib2.0-cil: libmono-corlib2.0-cil depends on mono-runtime (>= 2.6.7); however: Package mono-runtime is not configured yet. libmono-corlib2.0-cil depends on mono-runtime (<< 2.6.8); however: Package mono-runtime is not configured yet. dpkg: error processing libmono-corlib2.0-cil (--configure): dependency problems - leaving unconfigured configured to not write apport reports configured to not write apport reports dpkg: dependency problems prevent configuration of libmono-system2.0-cil: libmono-system2.0-cil depends on libmono-corlib2.0-cil (>= 2.6.3); however: Package libmono-corlib2.0-cil is not configured yet. libmono-system2.0-cil depends on mono-runtime (>= 2.6.7); however: Package mono-runtime is not configured yet. libmono-system2.0-cil depends on mono-runtime (<< 2.6.8); however: Package mono-runtime is not configured yet. dpkg: error processing libmono-system2.0-cil (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libmono-posix2.0-cil: libmono-posix2.0-cil depends on libmono-corlib2.0-cil (>= 2.6.3); however: Package libmono-corlib2.0-cil is not configured yet. libmono-posix2.0-cil depends on libmono-system2.0-cil (>= 2.6.3); however: Package libmono-system2.0-cil is not configured yet. libmono-posix2.0-cil depends on mono-runtime (>= 2.4); however: Package mono-runtime is not configured yet. dpkg: error processing libmono-posix2.0-cil (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libglib2.0-cil: libglib2.0-cil depends on libmono-corlib2.0-cil (>= 1.2.2.1); however: Package libmono-corlib2.0-cil is not configured yet. libglib2.0-cil depends on libmono-system2.0-cil (>= 2.4.3); however: Package libmono-system2.0-cil is not configured yet. dpkg: error processing libglib2.0-cil (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuraconfigured to not write apport reports configured to not write apport reports configured to not write apport reports configured to not write apport reports tion of libglib2.0-cil-dev: libglib2.0-cil-dev depends on libglib2.0-cil (= 2.12.10-1); however: Package libglib2.0-cil is not configured yet. dpkg: error processing libglib2.0-cil-dev (--configure): dependency problems - leaving unconfigured Setting up libglib2.0-0 (2.24.2-1) ... Setting up libglib2.0-data (2.24.2-1) ... Setting up libglib2.0-dev (2.24.2-1) ... Setting up libglib2.0-doc (2.24.2-1) ... Setting up libglib2.0-0-dbg (2.24.2-1) ... Setting up libglib2.0-0-refdbg (2.24.2-1) ... Errors were encountered while processing: mono-gac mono-runtime libmono-corlib2.0-cil libmono-system2.0-cil libmono-posix2.0-cil libglib2.0-cil libglib2.0-cil-dev E: Sub-process /usr/bin/dpkg returned an error code (1)
apt-get check 沒有發現任何損壞的部門,所以它並沒有真正幫助。值得慶幸的是,似乎沒有什麼重大問題被打破。正如我所說,因為自從我編譯 libglib 以來已經有一段時間了,我真的不記得我做了什麼,而且我不知道如何恢復它。
因此,問題是由於我在
/usr/local/
. 因為不記得自己編譯的具體版本了,就去/usr/local/lib/pkgconfig/
查看libglib2.0-0.pc
文件,報的是2.16版本。因為我沒有源文件,所以我從 http://ftp.gnome.org/pub/gnome/sources/glib/2.16/glib-2.16.6.tar.gz重新下載並做make uninstall
,從而刪除了所有有問題的文件,並且apt-get update && apt-get upgrade
一切都恢復了正常。