Installing elasticsearch on linux

Hi,

I am trying to install elasticsearch 5.1 on Red Hat Enterprise Linux Server release 7.2
following the link :-https://www.elastic.co/guide/en/elasticsearch/reference/5.1/rpm.html

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: https://artifacts.elastic.co/GPG-KEY-elasticsearch: key 1 import failed.

You must be logged as root or run in sudo

Hi,

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.

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

Hi,

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

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

Hi,

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.