编译安装transmission时,提示如下错误:
checking for LIBEVENT... configure: error: Package requirements (libevent >= 2.0.10) were not met:
No package 'libevent' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables LIBEVENT_CFLAGS
and LIBEVENT_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
发现当前libevent版本确实过低,这里要求版本>=2.0.10,于是重新编译了高版本的libevent,但是再次执行transmission编译还是在继续报这个错误,于是我又换了libevent版本重新编译,问题依旧存在。
在网上搜了很多文章,都是介绍libevent编译的过程的,真的是解决不了transmission的这个编译报错啊~~
困扰了我好一会,发现这个报错中有这么一句,设置环境变量PKG_CONFIG_PATH,于是乎我手动指定下,将transmission编译参数改成PKG_CONFIG_PATH=/usr/lib/pkgconfig ./configure终于解决了libevent >= 2.0.10问题
注意:我编译libevent时--prefix路径/usr,根据情况自行更改PKG_CONFIG_PATH路径
另一种方法:直接添加到.bashrc里
1 |
echo "export PKG_CONFIG_PATH=/usr/lib/pkgconfig" >> ~/.bashrc |
1 |
source ~/.bashrc |
附上一份libevent编译过程
安装所需依赖,卸载旧版本libevent
1 |
yum install gcc gcc-c++ make |
1 |
yum remove libevent |
libevent官网http://libevent.org
下载libevent稳定版的包,我这里选择的是libevent-2.18稳定版(由于是国外资源,可能需要代理才能下载,我这里提供一个本地的下载包和官网的版本一样wget https://down.whsir.com/downloads/libevent-2.1.8-stable.tar.gz)
1 |
wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz |
1 |
tar zxf libevent-2.1.8-stable.tar.gz |
1 |
cd libevent-2.1.8-stable |
1 |
./configure --prefix=/usr |
1 |
make && make install |
原文链接:解决transmission编译时libevent >= 2.0.10问题(亲测),转载请注明来源!