CentOS6中源码安装libvirt的问题

libvirt是一套免费、开源的支持Linux下主流虚拟化工具的C函数库,其旨在为包括Xen在内的各种虚拟化工具提供一套方便、可靠的编程接口,支持与C,C++,Ruby,Python等多种主流开发语言的绑定。

Q1:

在执行./configure的时候出现:You must install the libyajl library & headers to compile libvirt
提示缺少libyajl库,属于JSON库。
最开始采用rpm安装该库,出错,改为采用源码安装libyajl库,该库托管在github上
 安装方法:git clone git://github.com/lloyd/yajl
 cd yajl
 ./configure
 make
 make install

Q2:

注意在./configure的时候加上附加参数:./configure –prefix=/usr –localstatedir=/var –sysconfdir=/etc
执行make install的时候,出现 error ,意思就是与之前的冲突,指定目录后可以覆盖掉。

Q3:

安装完成之后执行virsh或者libvirtd都会出现:
while loading shared libraries: libXXX.so.x: cannot open shared object file: No such file or directory .说明未找到共享链接库位置,
 此时修改/etc/ld.so.conf,将指定的路径加进去,比如指定的是usr,那么.so的文件在/usr/local/lib下
 执行ldconfig使配置文件生效。
 官网:At this point you may have to run ldconfig or a similar utility to update your list of installed shared libs.
 ldconfig:
 它是一个程序,通常它位于/sbin下,是root用户使用的东东。具体作用及用法可以man ldconfig查到,它的作用就是将/etc/ld.so.conf列出的路径下的库文件 缓存到/etc/ld.so.cache 以供使用

猜你喜欢

转载自www.linuxidc.com/Linux/2016-07/133469.htm