Updating Elasticsearch on Linux

Table of Contents

To update Elasticsearch on Linux:

  1. Download the latest Elasticsearch and Kibana packages from the Elastic website:
  1. Check the repository definition in the article:
  1. Go to “/etc/apt/sources.list.d” (command cd /etc/apt/sources.list.d) and check the Elastic repository definition by running ls.
  1. Delete the present file by running “rm {file name}” (example: rm elastic-8.x.list).
  2. After removing your file, run ls again to check if it is gone. The output should look like this:

  1. Run the following command 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. Run ls again and check for the definition.

  1. Stop the Kibana service, and then stop the Elasticsearch 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. Run sudo apt upgrade elasticsearch to update Elasticsearch.

  1. Select Y to continue.
  2. Do the same with Kibana by running sudo apt upgrade kibana.

  1. Select Y to continue.
  2. You may see a prompt asking about a configuration file.

  1. Select N for that.
  2. Now, you can start your services again.

  1. Go to the address of your Elasticsearch.

  1. Select Advanced.

  1. Select Continue to the address.
  2. Log in using the Elastic superuser account.

  1. Check the displayed information to confirm that you have the latest stable version of Elastic installed.

You will see your current Elasticsearch version here.

  1. Go to your Kibana address.
  2. Log in using the Elastic superuser account.

  1. To check the version, select the icon shown below in the upper-right corner.

  1. Stop Kibana by running sudo systemctl stop kibana.service.

If both versions match, your Elasticsearch update is complete.

Was this article helpful?

Please, contact us if you have any additional questions.