# Can not purge Logstash

**URL:** <https://discuss.elastic.co/t/can-not-purge-logstash/277225>\
**Category:** Logstash\
**Created:** [June 28, 2021, 12:24pm UTC](https://discuss.elastic.co/t/can-not-purge-logstash/277225 "2021-06-28T12:24:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vladimir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimir/32/91042_2.png) [@Vladimir](https://discuss.elastic.co/u/Vladimir)\
**Post date:** [June 28, 2021, 12:24pm UTC](https://discuss.elastic.co/t/can-not-purge-logstash/277225/1 "2021-06-28T12:24:39Z")

</div>

Hi, can somebody help me please to remove logstash from Ubuntu? I had a broken Elastic + Kibana + Logstash + Filebeat installtion so I decided to remove it completely and start installation again. All packages are gone only Logstash remaining. I can not purge it away. This is what I see about 15 minutes.

```auto
root@vmi503579:~# apt-get purge logstash
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  logstash*
0 upgraded, 0 newly installed, 1 to remove and 109 not upgraded.
After this operation, 625 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 118295 files and directories currently installed.)
Removing logstash (1:7.13.2-1) ...

```

As I try to list running processes related to logstash in another terminal get this

```auto
root@vmi503579:~# ps -x | grep logstash
3276623 pts/0 S+ 0:05 apt-get purge logstash
3276643 pts/1 Ss+ 0:00 /usr/bin/dpkg --status-fd 57 --no-triggers --force-depends --abort-after=1 --remove logstash:amd64
3276644 pts/1 S+ 0:00 /bin/sh /var/lib/dpkg/info/logstash.prerm remove
3276645 pts/1 S+ 0:00 systemctl stop logstash

```

Is there something else what has to be stopped or removed before Logstash purge?

Thank you.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [June 28, 2021, 4:35pm UTC](https://discuss.elastic.co/t/can-not-purge-logstash/277225/2 "2021-06-28T16:35:33Z")

</div>

> [@Vladimir](#):
>
> `3276645 pts/1 S+ 0:00 systemctl stop logstash`

That looks like it is trying to stop the logstash service and it is hanging doing so. If you cannot stop the service I would suggest disabling it and rebooting. The system should then come up without logstash and apt-get should not feel the need to stop it.

---

<div class="post-metadata">

**Author:** ![Vladimir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimir/32/91042_2.png) [@Vladimir](https://discuss.elastic.co/u/Vladimir)\
**Post date:** [June 28, 2021, 5:44pm UTC](https://discuss.elastic.co/t/can-not-purge-logstash/277225/3 "2021-06-28T17:44:17Z")

</div>

In join with [this thread](https://askubuntu.com/questions/1348654/how-to-purge-logstash) I was able to remove Logstash. Thank you very much.

---

<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 26, 2021, 5:44pm UTC](https://discuss.elastic.co/t/can-not-purge-logstash/277225/4 "2021-07-26T17:44:40Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
