我相信老手都知道该怎么做(因为这个问题似乎已经被问过无数次了),但是我在./configure
从源代码安装一个软件时出现了这个错误:
*** 'pkg-config --modversion glib-2.0' returned 2.48.1, but GLIB (2.48.0)
*** was found! If pkg-config was correct, then it is best
*** to remove the old version of GLib. You may also be able to fix the error
*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing
*** /etc/ld.so.conf. Make sure you have run ldconfig if that is
*** required on your system.
*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH
*** to point to the correct configuration files
并且我尝试了其他线程中发现的所有修复方法但都无济于事...我已经尝试了所有通常建议的PATH
修改,包括但不限于:
LD_LIBRARY_PATH=/usr/local/lib
PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/
PKG_CONFIG_PATH=/usr/lib/pkgconfig/
PATH=/usr/local/bin:$PATH
ACLOCAL_PATH=/usr/local/share/aclocal/
export CPATH=/usr/local/include
以及所有可能的组合,只要有一个选项。我假设我可以运行一些诊断程序来找出我的(真正的?)glib 到底藏在哪里以及如何将有问题的程序(或 pkg-config)指向它,但我不知道那会是什么。
另一个类似性质的问题中建议的命令的一些输出:
find /usr/ -iname "*glib*.pc"
产量
find: ‘/usr/share/doc/google-chrome-stable’: Permission denied
/usr/lib/pkgconfig/glib-2.0.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/spice-client-glib-2.0.pc
并dpkg -l libglib2.0-dev
产生
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
un libglib2.0-dev <none> <none> (no description available)
为了参考,我尝试了这里和这里的解决方案(从第二个线程中相当自由地使用该词):
如何解决使用 jhbuild 安装“pygobject”时出现的旧 GLIB 错误
和这里:
还有这里和这里:
http://www.linuxquestions.org/questions/linux-newbie-8/configure-requested-'glib-2-0-%3D-2-32-0'-但卸载的 glib 版本是 2-29-2-a-4175442396/
http://ubuntuforums.org/showthread.php?t=2002738
Ubuntu 16.04,供参考...我一直在四处寻找,似乎卸载 glib 并重新安装是不行的(系统过于依赖它),但目前其他一切都运行良好...我只是在努力安装这个新东西。谢谢!
答案1
您的dpkg
命令无法捕获所有内容。请尝试以下命令:
$ dpkg -l libglib2*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=================-=============-=============-=======================================
ii libglib2.0-0:amd6 2.48.2-0ubunt amd64 GLib library of C routines
ii libglib2.0-bin 2.48.2-0ubunt amd64 Programs for the GLib library
ii libglib2.0-data 2.48.2-0ubunt all Common files for GLib library
虽然我的 Ubuntu 16.04 完全满足我的需求,但似乎我也遇到了类似的glib
错误。不过我会忽略它们,因为我不需要重新安装glib
:
$ sudo apt install libglib2.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libglib2.0-0-refdbg' for regex 'libglib2.0'
Note, selecting 'libglib2.0-cil-dev' for regex 'libglib2.0'
Note, selecting 'libglib2.0-tests' for regex 'libglib2.0'
Note, selecting 'libglib2.0-0-dbg' for regex 'libglib2.0'
Note, selecting 'libglib2.0-bin' for regex 'libglib2.0'
Note, selecting 'libglib2.0-cil' for regex 'libglib2.0'
Note, selecting 'libglib2.0-dbg' 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-data' for regex 'libglib2.0'
Note, selecting 'libglib2.0-0' for regex 'libglib2.0'
libglib2.0-0 is already the newest version (2.48.2-0ubuntu1).
libglib2.0-data is already the newest version (2.48.2-0ubuntu1).
libglib2.0-bin is already the newest version (2.48.2-0ubuntu1).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help resolve the situation:
The following packages have unmet dependencies:
libglib2.0-0-dbg : Depends: libglib2.0-0 (= 2.48.0-1ubuntu4) but 2.48.2-0ubuntu1 is to be installed
libglib2.0-0-refdbg : Depends: libglib2.0-0 (= 2.48.0-1ubuntu4) but 2.48.2-0ubuntu1 is to be installed
libglib2.0-dev : Depends: libglib2.0-0 (= 2.48.0-1ubuntu4) but 2.48.2-0ubuntu1 is to be installed
Depends: libglib2.0-bin (= 2.48.0-1ubuntu4)
Depends: zlib1g-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
一方面,消息说已安装最新版本,另一方面,消息说安装了错误的版本。最后,消息说有损坏的软件包。