Installing elasticsearch on linux


I am trying to install elasticsearch 5.1 on Red Hat Enterprise Linux Server release 7.2
following the link :-

The first step tells to download ans install the public signing key
but I am getting below error:-
error: cannot open Packages index using db5 - Permission denied (13)
error: cannot open Packages database in /var/lib/rpm
error: key 1 import failed.

You must be logged as root or run in sudo


Thanks for the response. It woked.

I am trying to create elasticsearch.repo inside /etc/yum.repos.d path using vi
I am able to insert in it.
I am able to enter command mode by pressing escape key.
But when I try to save and quit using :wq I am getting below error.

E212: Can't open file for writing
Press ENTER or type command to continue


You need be root or sudo when writing in files too.

sudo vi /etc/yum.repos.d/elasticsearch.repo


I am getting the same issue when I use sudo.
However, instead of :wq , I typed this :w !sudo tee % > /dev/null.
and it worked.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.