Elastic search service failing - java.lang.IllegalArgumentException: Plugin [delete-by-query] is incompatible with Elasticsearch [2.4.5]. Was designed for version [2.4.4]

java.lang.IllegalArgumentException: Plugin [delete-by-query] is incompatible with Elasticsearch [2.4.5]. Was designed for version [2.4.4]
at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:118)
at org.elasticsearch.plugins.PluginsService.getPluginBundles(PluginsService.java:378)
at org.elasticsearch.plugins.PluginsService.(PluginsService.java:128)
at org.elasticsearch.node.Node.(Node.java:158)
at org.elasticsearch.node.Node.(Node.java:140)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:143)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:194)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:286)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:45)

I have installed elastic search as package and running as service, what should I do to fix this issue?

If it is a new setup try to upgrade to 5.x. We have stable & advanced
features(also delete-by-query) available in that.

Remove the old version of the plugin first.
Then if you need this plugin install it again.
Then start the service

I have installed elastic search using apt

wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb http://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list
sudo apt-get update && sudo apt-get install elasticsearch

How do I use sudo bin/plugin remove [pluginname] in this case?

/usr/share/elasticsearch/bin/plugin remove [pluginname]

or

rm -r /usr/share/elasticsearch/plugins/[pluginname]

It is not a new setup. What you think is the showstopper to upgrade existing setup to 5.x.

  1. If it is only data loss, I am not worried, because I have a copy of my data in SQL.
  2. I have tested the upgrade in my local dev environment, upgrading did not delete any existing index and there was no data loss