# How to remove Sensu-go-agent completely from the system

**URL:** <https://discourse.sensu.io/t/how-to-remove-sensu-go-agent-completely-from-the-system/3069>\
**Category:** Sensu Go\
**Tags:** sensu-go\
**Created:** [January 25, 2023, 8:41pm UTC](https://discourse.sensu.io/t/how-to-remove-sensu-go-agent-completely-from-the-system/3069 "2023-01-25T20:41:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff-fongo](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/jeff-fongo/32/648_2.png) [@jeff-fongo](https://discourse.sensu.io/u/jeff-fongo)\
**Post date:** [January 25, 2023, 8:41pm UTC](https://discourse.sensu.io/t/how-to-remove-sensu-go-agent-completely-from-the-system/3069/1 "2023-01-25T20:41:54Z")

</div>

Hi,  
How can I remove sensu from a Ubuntu or Debian system?  
I ran `apt remove --purge sensu-go-agent` but I still have some folders and the service running

Thanks

---

<div class="post-metadata">

**Author:** ![aaronsachs](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/aaronsachs/32/47_2.png) [@aaronsachs](https://discourse.sensu.io/u/aaronsachs)\
**Post date:** [January 26, 2023, 3:09pm UTC](https://discourse.sensu.io/t/how-to-remove-sensu-go-agent-completely-from-the-system/3069/2 "2023-01-26T15:09:46Z")

</div>

Hey there, an `apt purge` should be completely removing the Sensu bits from the system. Since it’s not, here are the default paths for the agent and the backend:

**Backend**

```auto
dpkg -c sensu-go-backend_6.9.1-6928_amd64.deb
drwxr-xr-x root/root 0 2022-12-01 17:01 ./etc/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./etc/sensu/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./usr/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./usr/sbin/
-rwxr-xr-x root/root 42176512 2022-12-01 16:54 ./usr/sbin/sensu-backend
drwxr-xr-x root/root 0 2022-12-01 17:01 ./usr/share/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./usr/share/doc/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./usr/share/doc/sensu-go-backend-6.9.1/
-r--r--r-- root/root 100 2022-12-01 16:55 ./usr/share/doc/sensu-go-backend-6.9.1/LICENSE.txt
-r--r--r-- root/root 82 2022-12-01 17:01 ./usr/share/doc/sensu-go-backend-6.9.1/README.txt
-rw-r--r-- root/root 1772 2022-12-01 16:55 ./usr/share/doc/sensu-go-backend-6.9.1/backend.yml.example
drwxr-xr-x root/root 0 2022-12-01 17:01 ./usr/share/sensu-go-backend-6.9.1/
-rw-r--r-- root/root 4174 2022-12-01 16:55 ./usr/share/sensu-go-backend-6.9.1/sensu-backend
-rw-r--r-- root/root 605 2022-12-01 16:55 ./usr/share/sensu-go-backend-6.9.1/sensu-backend.service
drwxr-xr-x root/root 0 2022-12-01 17:01 ./var/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./var/cache/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./var/cache/sensu/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./var/cache/sensu/sensu-backend/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./var/lib/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./var/lib/sensu/
drwxr-x--- root/root 0 2022-12-01 17:01 ./var/lib/sensu/sensu-backend/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./var/log/
drwxr-x--- root/root 0 2022-12-01 17:01 ./var/log/sensu/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./var/run/
drwxr-x--- root/root 0 2022-12-01 17:01 ./var/run/sensu/

```

**Agent**

```auto
dpkg -c sensu-go-agent_6.9.1-6928_amd64.deb
drwxr-xr-x root/root 0 2022-12-01 17:01 ./etc/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./etc/sensu/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./usr/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./usr/sbin/
-rwxr-xr-x root/root 20123648 2022-12-01 16:54 ./usr/sbin/sensu-agent
drwxr-xr-x root/root 0 2022-12-01 17:01 ./usr/share/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./usr/share/doc/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./usr/share/doc/sensu-go-agent-6.9.1/
-r--r--r-- root/root 100 2022-12-01 16:55 ./usr/share/doc/sensu-go-agent-6.9.1/LICENSE.txt
-r--r--r-- root/root 80 2022-12-01 17:01 ./usr/share/doc/sensu-go-agent-6.9.1/README.txt
-rw-r--r-- root/root 1348 2022-12-01 16:55 ./usr/share/doc/sensu-go-agent-6.9.1/agent.yml.example
drwxr-xr-x root/root 0 2022-12-01 17:01 ./usr/share/sensu-go-agent-6.9.1/
-rw-r--r-- root/root 4146 2022-12-01 16:55 ./usr/share/sensu-go-agent-6.9.1/sensu-agent
-rw-r--r-- root/root 560 2022-12-01 16:55 ./usr/share/sensu-go-agent-6.9.1/sensu-agent.service
drwxr-xr-x root/root 0 2022-12-01 17:01 ./var/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./var/cache/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./var/cache/sensu/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./var/cache/sensu/sensu-agent/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./var/lib/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./var/lib/sensu/
drwxr-x--- root/root 0 2022-12-01 17:01 ./var/lib/sensu/sensu-agent/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./var/log/
drwxr-x--- root/root 0 2022-12-01 17:01 ./var/log/sensu/
drwxr-xr-x root/root 0 2022-12-01 17:01 ./var/run/
drwxr-x--- root/root 0 2022-12-01 17:01 ./var/run/sensu/

```

Removing all of those files should completely purge Sensu from your system.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/sensu/original/1X/ad88ecc0d60777fbbb8dad05fe976fca2a4d87b2.jpeg) [@system](https://discourse.sensu.io/u/system)\
**Post date:** [February 25, 2023, 3:09pm UTC](https://discourse.sensu.io/t/how-to-remove-sensu-go-agent-completely-from-the-system/3069/3 "2023-02-25T15:09:55Z")

</div>

Closed on February 25, 2023, 3:09pm UTC

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