# Cannot uninstall endpoint agent

**URL:** <https://discuss.elastic.co/t/cannot-uninstall-endpoint-agent/371315>\
**Category:** Elastic Security\
**Created:** [December 2, 2024, 12:57pm UTC](https://discuss.elastic.co/t/cannot-uninstall-endpoint-agent/371315 "2024-12-02T12:57:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LaserBits](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/laserbits/32/134295_2.png) [@LaserBits](https://discuss.elastic.co/u/LaserBits)\
**Post date:** [December 2, 2024, 12:57pm UTC](https://discuss.elastic.co/t/cannot-uninstall-endpoint-agent/371315/1 "2024-12-02T12:57:35Z")

</div>

I cannot uninstall the agent from a specific endpoint.

The terminal command goes through and then forever hangs on the stopping service message. It appears to be running but never gets pass it.

If I cannot uninstall , is it possible to do a new installation and add the endpoint to a new server ?

---

<div class="post-metadata">

**Author:** ![lesio](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lesio/32/89323_2.png) [@lesio](https://discuss.elastic.co/u/lesio)\
**Post date:** [December 4, 2024, 9:23am UTC](https://discuss.elastic.co/t/cannot-uninstall-endpoint-agent/371315/2 "2024-12-04T09:23:31Z")

</div>

I would try to use the global flags to get more output

> **[Elastic Agent command reference | Fleet and Elastic Agent Guide \[8.16\] | Elastic](https://www.elastic.co/guide/en/fleet/current/elastic-agent-cmd-options.html#elastic-agent-global-flags)**

Anyway, since you're posting in Elastic Security I guess you have Elastic Defend in the policy, so I would suggest to try removing the Endpoint service first

> **[Elastic Endpoint command reference | Elastic Security Solution \[8.16\] | Elastic](https://www.elastic.co/guide/en/security/current/endpoint-command-ref.html)**

---

<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:** [January 1, 2025, 9:24am UTC](https://discuss.elastic.co/t/cannot-uninstall-endpoint-agent/371315/3 "2025-01-01T09:24:21Z")

</div>

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