# Installed Elastic-Agent cannot be removed

**URL:** <https://discuss.elastic.co/t/installed-elastic-agent-cannot-be-removed/350473>\
**Category:** Elastic Agent\
**Tags:** fleet\
**Created:** [January 5, 2024, 3:28pm UTC](https://discuss.elastic.co/t/installed-elastic-agent-cannot-be-removed/350473 "2024-01-05T15:28:57Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ghuie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ghuie/32/130569_2.png) [@ghuie](https://discuss.elastic.co/u/ghuie)\
**Post date:** [January 5, 2024, 3:36pm UTC](https://discuss.elastic.co/t/installed-elastic-agent-cannot-be-removed/350473/2 "2024-01-05T15:36:06Z")

</div>

i found this:

> [@Elastic agent uninstall](https://discuss.elastic.co/t/elastic-agent-uninstall/349659/5):
>
> I did this and now it is enrolled, topic can be closed rm /etc/systemd/system/elastic-agent.service root@elk:/opt/Elastic# rm -r Agent curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-8.11.2-linux-x86\_64.tar.gz tar xzvf elastic-agent-8.11.2-linux-x86\_64.tar.gz cd elastic-agent-8.11.2-linux-x86\_64 sudo ./elastic-agent install --url=https://:8220 --fleet-server-es=[https://localhost:9200](https://localhost:9200) --fleet-server-service-token= --fleet-server-policy=fleet-server-…

I'll give updates.

---

_[View the full topic](https://discuss.elastic.co/t/installed-elastic-agent-cannot-be-removed/350473)._
