When I try to install ejabberd on ubuntu, it removes the erlang installed previously. Thus I'm not able to compile any erl files.
I had installed erlang-els. After installing ejabberd, trying to again install erlang gives error about dependancy trees.
Need help to get both, ejabberd and erlang installed.
You should use ejabberd binary installer from ProcessOne. It comes prepackaged, preconfigured, with its own Erlang. See this download page: https://www.process-one.net/en/ejabberd/downloads/