前言:对于centos7.3我使用yum安装不上erlang,才有了这边编译安装erlang的文章。在安装erlang过程中遇到不少坑,最终经过努力把rabbitmq装上。
按照官方的办法安装erlang报错,rpm包也是一样:
Error: Package: erlang-wx-20.0rc1-3.el7.centos.x86_64 (erlang-solutions)Requires: libwx_baseu-2.8.so.0()(64bit)Error: Package: erlang-wx-20.0rc1-3.el7.centos.x86_64 (erlang-solutions)Requires: libwx_gtk2u_gl-2.8.so.0()(64bit)Error: Package: erlang-wx-20.0rc1-3.el7.centos.x86_64 (erlang-solutions)Requires: libwx_gtk2u_xrc-2.8.so.0()(64bit)Error: Package: erlang-wx-20.0rc1-3.el7.centos.x86_64 (erlang-solutions)Requires: libwx_gtk2u_html-2.8.so.0()(64bit)Error: Package: erlang-wx-20.0rc1-3.el7.centos.x86_64 (erlang-solutions)Requires: libwx_gtk2u_html-2.8.so.0(WXU_2.8)(64bit)Error: Package: erlang-wx-20.0rc1-3.el7.centos.x86_64 (erlang-solutions)Requires: libwx_gtk2u_aui-2.8.so.0(WXU_2.8.5)(64bit)Error: Package: erlang-wx-20.0rc1-3.el7.centos.x86_64 (erlang-solutions)Requires: libwx_gtk2u_xrc-2.8.so.0(WXU_2.8)(64bit)Error: Package: erlang-wx-20.0rc1-3.el7.centos.x86_64 (erlang-solutions)Requires: libwx_baseu_xml-2.8.so.0()(64bit)Error: Package: erlang-wx-20.0rc1-3.el7.centos.x86_64 (erlang-solutions)Requires: libwx_gtk2u_adv-2.8.so.0()(64bit)Error: Package: erlang-wx-20.0rc1-3.el7.centos.x86_64 (erlang-solutions)Requires: libwx_gtk2u_stc-2.8.so.0(WXU_2.8)(64bit)Error: Package: erlang-wx-20.0rc1-3.el7.centos.x86_64 (erlang-solutions)Requires: libwx_gtk2u_core-2.8.so.0()(64bit)Error: Package: erlang-wx-20.0rc1-3.el7.centos.x86_64 (erlang-solutions)Requires: libwx_gtk2u_core-2.8.so.0(WXU_2.8)(64bit)Error: Package: erlang-wx-20.0rc1-3.el7.centos.x86_64 (erlang-solutions)Requires: libwx_gtk2u_stc-2.8.so.0()(64bit)Error: Package: erlang-wx-20.0rc1-3.el7.centos.x86_64 (erlang-solutions)Requires: libwx_gtk2u_aui-2.8.so.0()(64bit)Error: Package: erlang-wx-20.0rc1-3.el7.centos.x86_64 (erlang-solutions)Requires: libwx_gtk2u_adv-2.8.so.0(WXU_2.8)(64bit)Error: Package: erlang-wx-20.0rc1-3.el7.centos.x86_64 (erlang-solutions)Requires: libwx_gtk2u_gl-2.8.so.0(WXU_2.8)(64bit)Error: Package: erlang-wx-20.0rc1-3.el7.centos.x86_64 (erlang-solutions)Requires: libwx_gtk2u_core-2.8.so.0(WXU_2.8.10)(64bit)Error: Package: erlang-wx-20.0rc1-3.el7.centos.x86_64 (erlang-solutions)Requires: libwx_gtk2u_aui-2.8.so.0(WXU_2.8)(64bit)Error: Package: erlang-wx-20.0rc1-3.el7.centos.x86_64 (erlang-solutions)Requires: libwx_baseu-2.8.so.0(WXU_2.8)(64bit)You could try using --skip-broken to work around the problemYou could try running: rpm -Va --nofiles --nodigest
以下只是仅仅记录我的安装过程以及问题解决:
1. 安装erlang
#安装依赖环境yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel unixODBC-devel#下载最新 Erlang 19.0wget http://erlang.org/download/otp_src_19.0.tar.gz#解压tar -xvzf otp_src_19.0.tar.gz#配置./configure --prefix=/usr/local/erlang#检测完毕后提示这个******************************************************************************************* APPLICATIONS INFORMATION ****************************************************************************************wx : wxWidgets not found, wx will NOT be usable**************************************************************************************************************************************************************** DOCUMENTATION INFORMATION ***************************************************************************************documentation :fop is missing.Using fakefop to generate placeholder PDF files.*********************************************************************#解决wxWidgets才能make和make installmake && make install#解决 wxWidgetswget -c https://github.com/wxWidgets/wxWidgets/releases/download/v3.0.3/wxWidgets-3.0.3.tar.bz2yum install bzip2 -ybzip2 -d wxWidgets-3.0.3.tar.bz2tar -xvf wxWidgets-3.0.3.tarcd wxWidgets-3.0.3./configure#检测wxWidgets出错configure: error:The development files for GTK+ were not found. For GTK+ 2, pleaseensure that pkg-config is in the path and that gtk+-2.0.pc isinstalled. For GTK+ 1.2 please check that gtk-config is in the path,and that the version is 1.2.3 or above. Also check that thelibraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config--libs' are in the LD_LIBRARY_PATH or equivalent.#解决GTK+,先安装gtk2-devel和binutilsyum -y install gtk2-devel binutils-develyum install libSM-devel#可以不安装yum list pkgconfigyum install gtk+extra#再次./configure出现openGL报错error: OpenGL libraries not available#解决OpenGLyum install mesa-libGL-develyum install mesa-libGLU-devel#编译安装make && make install
2. 安装 rabbitmq,必须要首先安装erlang
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.10/rabbitmq-server-generic-unix-3.6.10.tar.xzxz -d rabbitmq-server-generic-unix-3.6.10.tar.xztar -xvf rabbitmq-server-generic-unix-3.6.10.tarcd ./rabbitmq_server-3.6.10cd sbin/#修改ERL_DIR路径vim rabbitmq-defaults修改为ERL_DIR=/usr/local/erlang/bin/启用web管理界面./rabbitmq-plugins enable rabbitmq_management启动./rabbitmq-server -detached添加用户./rabbitmqctl add_user admin 111111设置权限./rabbitmqctl set_user_tags admin administrator添加访问权限rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"浏览器访问ip:15672
PS:经过使用eralng19.0不支持rabbitmq3.6.4以下
如3.6.3版本rabbitmq的web端管理界面不能查看、管理queues
#2017/07/20更新
后来我发现yum方法可以解决eralng关系,在rabbitmq的github上介绍的完美快捷方案。
我使用的erlang是19.x
添加仓库
vim /etc/yum.repos.d/rabbitmq-erlang.repo
[rabbitmq-erlang]name=rabbitmq-erlangbaseurl=https://dl.bintray.com/rabbitmq/rpm/erlang/19/el/7gpgcheck=1gpgkey=https://www.rabbitmq.com/rabbitmq-release-signing-key.ascrepo_gpgcheck=0enabled=1
然后执行yum安装erlang
yum install erlang -y
然后再添安装最新版rabbitmq
yum install rabbitmq-server -y
如果不是你所要的版本,去官网下载最新rpm包
wget -c https://bintray.com/rabbitmq/rabbitmq-server-rpm/download_file?file_path=rabbitmq-server-3.6.10-1.el7.noarch.rpmyum install rabbitmq-server-3.6.10-1.el7.noarch.rpm