CentOS7.1安装libvmi时no package ‘libvmi’ found问题解决

  • 此问题为安装libvmi后在安装pyvmi时出现
  • libvmi安装过程
# sudo ./autogen.sh
# sudo ./configure
# sudo make
# sudo make install
  • libvmi默认安装目录是/usr/local,libvmi.pc这个文件在/usr/local/lib/pkgconfig下
  • 进入libvmi的解压包下的/tools/pyvmi进行pyvmi安装时需要用到libvmi.pc这个文件
# sudo python setup.py build
# sudo python setup.py install
  • 在build时可能报以下的错
Package libvmi was not found in the pkg-config search path.
Perhaps you shoud add the directory containing `libvmi.pc` to the PKG_CONFIG_PATH environment variable
No package `libvmi` found:没有那个文件或目录
  • 原因在于安装pyvmi时需要用到libvmi.pc,其搜索路径为pkg-config.而pkg-config在大多数操作系统上主要包括以下几个目录:
/usr/lib/pkgconfig
/usr/share/pkgconfig
/usr/local/lib/pkgconfig
/usr/local/share/pkgconfig
  • 经验证在CentOS7.1下安装pyvmi时搜索的目录为/usr/share/pkgconfig,所以把/usr/local/lib/pkgconfig下的libvmi.pc复制到该目录下
# sudo cp /usr/local/lib/pkgconfig/libvmi.pc /usr/share/pkgconfig

发表评论