# Complete removal

**URL:** <https://discuss.elastic.co/t/complete-removal/22067>\
**Category:** Elasticsearch\
**Created:** [February 10, 2015, 3:59pm UTC](https://discuss.elastic.co/t/complete-removal/22067 "2015-02-10T15:59:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Onno](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/onno/32/922_2.png) [@Onno](https://discuss.elastic.co/u/Onno)\
**Post date:** [February 10, 2015, 3:59pm UTC](https://discuss.elastic.co/t/complete-removal/22067/1 "2015-02-10T15:59:34Z")

</div>

Something is wrong with my elasticsearch instance. It complains about  
unassigned shards en cluster health is red.

I was wondering if it is possible to do complete removal of Elasticsearch.  
That way I can easily recover from the problems by removal and install.  
This however does seem to be straightforward to the point that it makes me  
wonder if it is at all possible.

This is under Ubuntu 14.04 something and elasticsearch 1.4.2.

Using Ubuntu software centre I can remove 1.4.2 but directory remains. So  
normal software remove does not seem to do a lot.

If I combine that with removal of directories left by Elasticsearch  
scattered throughtout the file system, it seems to end with a corruption of  
some sort. Elasticsearch won't install.  
Setting up elasticsearch (1.4.2) ...

chown: cannot access /etc/elasticsearch/\*: No such file or directory

So the installation program expect a directory to exist prior to installation which is a bit strange. I would argue that one should either cleanup file system on uninstall 'or' don't make assumption on what it means if directories are present. It should be one of two not a bit of both.

Is there a documented way to recover from this that does not involve me doing a complete reinstall of the OS?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/578c1e0a-4dad-49b6-9420-ac9a4113cac6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/578c1e0a-4dad-49b6-9420-ac9a4113cac6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Onno](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/onno/32/922_2.png) [@Onno](https://discuss.elastic.co/u/Onno)\
**Post date:** [February 10, 2015, 4:18pm UTC](https://discuss.elastic.co/t/complete-removal/22067/2 "2015-02-10T16:18:14Z")

</div>

If you want complete reinstall of Elasticsearch you need to reinstall the  
OS. It is the only way. Elasticsearch was designed in such way that it  
requires full OS reinstall. If there is a corruption, this is what you  
should do. It is straightforward enough.

On Tuesday, 10 February 2015 16:59:34 UTC+1, Onno wrote:

> Something is wrong with my elasticsearch instance. It complains about  
> unassigned shards en cluster health is red.
> 
> I was wondering if it is possible to do complete removal of Elasticsearch.  
> That way I can easily recover from the problems by removal and install.  
> This however does seem to be straightforward to the point that it makes me  
> wonder if it is at all possible.
> 
> This is under Ubuntu 14.04 something and elasticsearch 1.4.2.
> 
> Using Ubuntu software centre I can remove 1.4.2 but directory remains. So  
> normal software remove does not seem to do a lot.
> 
> If I combine that with removal of directories left by Elasticsearch  
> scattered throughtout the file system, it seems to end with a corruption of  
> some sort. Elasticsearch won't install.  
> Setting up elasticsearch (1.4.2) ...
> 
> chown: cannot access /etc/elasticsearch/\*: No such file or directory
> 
> So the installation program expect a directory to exist prior to installation which is a bit strange. I would argue that one should either cleanup file system on uninstall 'or' don't make assumption on what it means if directories are present. It should be one of two not a bit of both.
> 
> Is there a documented way to recover from this that does not involve me doing a complete reinstall of the OS?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/43c872d0-af9b-4f90-a993-e182dd5a793d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/43c872d0-af9b-4f90-a993-e182dd5a793d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 10, 2015, 8:50pm UTC](https://discuss.elastic.co/t/complete-removal/22067/3 "2015-02-10T20:50:32Z")

</div>

No, it does not require you to reinstall the OS.  
You can use _apt-get purge elasticsearch_ to remove the package and any  
directories and files it created.

Also, reinstalling the OS just to fix your problem is a major waste of  
time, you should have tried to restore your cluster to green.

On 11 February 2015 at 03:18, Onno [onno.van.der.straaten@onknows.com](mailto:onno.van.der.straaten@onknows.com)  
wrote:

> If you want complete reinstall of Elasticsearch you need to reinstall the  
> OS. It is the only way. Elasticsearch was designed in such way that it  
> requires full OS reinstall. If there is a corruption, this is what you  
> should do. It is straightforward enough.
> 
> On Tuesday, 10 February 2015 16:59:34 UTC+1, Onno wrote:
> 
> > Something is wrong with my elasticsearch instance. It complains about  
> > unassigned shards en cluster health is red.
> > 
> > I was wondering if it is possible to do complete removal of  
> > Elasticsearch. That way I can easily recover from the problems by removal  
> > and install. This however does seem to be straightforward to the point that  
> > it makes me wonder if it is at all possible.
> > 
> > This is under Ubuntu 14.04 something and elasticsearch 1.4.2.
> > 
> > Using Ubuntu software centre I can remove 1.4.2 but directory remains. So  
> > normal software remove does not seem to do a lot.
> > 
> > If I combine that with removal of directories left by Elasticsearch  
> > scattered throughtout the file system, it seems to end with a corruption of  
> > some sort. Elasticsearch won't install.  
> > Setting up elasticsearch (1.4.2) ...
> > 
> > chown: cannot access /etc/elasticsearch/\*: No such file or directory
> > 
> > So the installation program expect a directory to exist prior to installation which is a bit strange. I would argue that one should either cleanup file system on uninstall 'or' don't make assumption on what it means if directories are present. It should be one of two not a bit of both.
> > 
> > Is there a documented way to recover from this that does not involve me doing a complete reinstall of the OS?
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/43c872d0-af9b-4f90-a993-e182dd5a793d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/43c872d0-af9b-4f90-a993-e182dd5a793d%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/43c872d0-af9b-4f90-a993-e182dd5a793d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/43c872d0-af9b-4f90-a993-e182dd5a793d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X8FTq9JDO1jaFjDwQOD39FgaewgtH8Ja%3DA6w83NmVijOQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X8FTq9JDO1jaFjDwQOD39FgaewgtH8Ja%3DA6w83NmVijOQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:33am UTC](https://discuss.elastic.co/t/complete-removal/22067/4 "2017-07-06T00:33:51Z")

</div>


