'Sudo Apt-Get Update' Does Not Work After Trying to Install Elasticsearch Through Apt-Get

First, I tried to install elasticsearch according to the instructions on the website

but after echo "deb stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-8.x.list

deb  stable main

but after that, when I try to $ sudo apt-get update

> E: Conflicting values set for option Signed-By regarding source
>  stable:
> /usr/share/keyrings/elasticsearch-keyring.gpg != E: The list of
> sources could not be read.   

but in keyrings, there is no elasticsearch-keyring.gpg

in keyrings,

docker-archive-keyring.gpg      
ubuntu-advantage-ros.gpg   
ubuntu-advantage-cc-eal.gpg                
ubuntu-archive-keyring.gpg   
ubuntu-advantage-cis.gpg               
ubuntu-archive-removed-keys.gpg    
ubuntu-advantage-esm-apps.gpg          
ubuntu-cloudimage-keyring.gpg   
ubuntu-advantage-esm-infra-trusty.gpg  
ubuntu-cloudimage-removed-keys.gpg    
ubuntu-advantage-fips.gpg              
ubuntu-master-keyring.gpg   

I already changed the file sources.list from /usr/share/doc/apt/examples/ to /etc/apt/
for reset the list

I don't know how to get it back. I can't install any package through apt now

someone please, help me T_T

4 Answers

I am by no means a linux or elasticsearch expert. I don't know if this is a GOOD solution. It could be a very nasty and BAD solution.

...But it allowed me to use apt-get again when I was having the same problem. Who knows, maybe the people who actually know the "correct" solution will respond if I trigger them with a dirty hack, haha.

In /etc/apt/sources.list.d, there's a file called "elastic-8.x.list", the same one used in the command you used above for installation. I removed the file and I could use apt-get again.

sudo rm /etc/apt/sources.list.d/elastic-8.x.list

I also removed the elasticsearch keyring, but that on it's own didn't work. It was removing the elastic list file that allowed things to work again.

sudo rm /usr/share/keyrings/elasticsearch-keyring.gpg

I hope my answer was helpful!

I had the same situation when trying to install Kibana after installing the Elasticsarch. Try these steps:

  1. Edit file: sudo nano /etc/apt/sources.list.d/elastic-8.x.list
  2. Delete the following line: deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] stable main
  3. Re-install Kibana

For me there was repeating deb stable main removing those repeating code worked.

The below steps worked for me.

STEP-1: Remove gpg file

rm /usr/share/keyrings/elastic.gpg

STEP-2 Remove this entry

deb [signed-by=/usr/share/keyrings/elastic.gpg]  stable main

from /etc/apt/sources.list.d/elastic-7.x.list

STEP-3

apt-get update

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest