Updating Elastic Search on Linux

Table of Contents
  1. Go to Elastic Search website to get the newest version:
  2. Check the repository definition inside the article:

  1. Go to /etc/apt/sources.list.d (command cd /etc/apt/sources.list.d) and check the repository definition of Elastic you have by running ls.

  1. Delete the present file by running “rm {file name}” (example: rm elastic-8.x.list).
  2. After your file is removed, run ls again to check if it is gone. The output should look like this:

  1. After that, run this command from the from the article:

echo "deb <a href="https://artifacts.elastic.co/packages/8.x/apt">https://artifacts.elastic.co/packages/8.x/apt</a> stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list

  1. Make sure you have the whole line copied.
  2. After that, run ls again and check for the definition.

  1. After that is done, stop the Kibana service, and then stop the Elastic Search service with these commands:

sudo systemctl stop kibana.service

sudo systemctl stop elasticsearch.service

Always stop Kibana first to avoid creating unnecessary conflicts.

  1. Run sudo apt-get update to load in the updated repository.

  1. After that, run sudo apt upgrade elasticsearch to update Elastic Search.

  1. Say “y” to continuing.
  2. Do the same with Kibana by running sudo apt upgrade kibana.

  1. Say “y” to continuing.
  2. A prompt might pop up asking about a configuration file.

  1. Say “n” to that.
  2. After that, you can start your services again.

  1. Go to the address of your elasticsearch.

  1. Click "Advanced".

  1. Continue to the address.
  2. Login with the Elastic superuser account.

  1. After you login, check the displayed information to confirm that you have the up-to-date stable version of elastic installed.

You will see your current Elastic Search version here.

  1. Go to your Kibana address.
  2. Login with the elastic superuser account.

  1. Press this icon on the top right corner to check the version.

You will see the current Kibana version here.

  1. After that, stop Kibana by running sudo systemctl stop kibana.service.

If both of the versions are matching, your update of Elastic Search is done.

Was this article helpful?

Please, contact us if you have any additional questions.