Update uninstaller documentation. (#13627)
* Update uninstaller documentation. * Apply suggestions from code review Co-authored-by: DShreve2 <david@netdata.cloud> * Fix typo. Co-authored-by: DShreve2 <david@netdata.cloud>
Austin S. Hemmelgarn committed
Sep 21, 2022 at 12:24 UTC
c66854bdd36277aba01ef8d17d478d92bba574da
1 file changed
+39
-13
packaging/installer/UNINSTALL.md
+39
-13
@@ -10,17 +10,41 @@ custom_edit_url: https://github.com/netdata/netdata/edit/master/packaging/instal
10
> issues with your Netdata Agent installation, consider our [**reinstall Netdata**
11
> doc](/packaging/installer/REINSTALL.md) instead of removing the Netdata Agent entirely.
12
13
-Our self-contained uninstaller is able to remove Netdata installations created with shell installer. It doesn't need any
14
-other Netdata repository files to be run. All it needs is an `.environment` file, which is created during installation
15
-(with shell installer) and put in `${NETDATA_USER_CONFIG_DIR}/.environment` (by default `/etc/netdata/.environment`).
16
-That file contains some parameters which are passed to our installer and which are needed during uninstallation process.
17
-Mainly two parameters are needed:
13
+The recommended method to uninstall Netdata on a system is to use our kickstart installer script with the `--uninstall` option like so:
14
15
```sh
20
-NETDATA_PREFIX
21
-NETDATA_ADDED_TO_GROUPS
16
+wget -O /tmp/netdata-kickstart.sh https://my-netdata.io/kickstart.sh && sh /tmp/netdata-kickstart.sh --uninstall
17
```
18
19
+Or (if you have curl but not wget):
20
+
21
+```sh
22
+curl https://my-netdata.io/kickstart.sh > /tmp/netdata-kickstart.sh && sh /tmp/netdata-kickstart.sha --uninstall
23
+```
24
+
25
+This will work in most cases without you needing to do anything more other than accepting removal of configuration
26
+and data files. You can confirm whether this approach will work for you by adding `--dry-run` to the list of
27
+options. If that produces a line with a message like `Would attempt to uninstall existing install`, then this
28
+method will work on your system.
29
+
30
+If you used a non-standard installation prefix, you may need to specify that prefix using the `--old-install-prefix`
31
+option when uninstalling this way.
32
+
33
+## Unofficial installs
34
+
35
+If you used a third-party package to install Netdata, then the above method will usually not work, and you will
36
+need to use whatever mechanism you used to originally install Netdata to uninstall it.
37
+
38
+## Uninstalling manually
39
+
40
+Most official installs of Netdata include an uninstaller script that can be manually invoked instead of using the
41
+kickstart script (internally, the kickstart script also uses this uninstaller script, it just handles the process
42
+outlined below for you).
43
+
44
+This uninstaller script is self-contained other than requiring a `.environment` file that was generated during
45
+installation. In most cases, this will be found in `/etc/netdata/.environment`, though if you used a non-standard
46
+installation prefix it will usually be located in a similar place under that prefix.
47
+
48
A workflow for uninstallation looks like this:
49
50
1. Find your `.environment` file, which is usually `/etc/netdata/.environment` in a default installation.
@@ -35,7 +59,9 @@ NETDATA_ADDED_TO_GROUPS="<additional groups>" # Additional groups for a user ru
59
60
3.1 **Interactive mode (Default)**
61
38
- The default mode in the uninstaller script is **interactive**. This means that the script provides the user the option to reply with "yes" (`y`/`Y`) or "no" (`n`/`N`) to control the removal of each Netdata asset in the filesystem.
62
+ The default mode in the uninstaller script is **interactive**. This means that the script provides you
63
+ the option to reply with "yes" (`y`/`Y`) or "no" (`n`/`N`) to control the removal of each Netdata asset in
64
+ the filesystem.
65
66
```sh
67
${NETDATA_PREFIX}/usr/libexec/netdata/netdata-uninstaller.sh --yes --env <environment_file>
@@ -43,7 +69,9 @@ NETDATA_ADDED_TO_GROUPS="<additional groups>" # Additional groups for a user ru
69
70
3.2 **Non-interactive mode**
71
46
- If you are sure and you know what you are doing, you can speed up the removal of the Netdata assets from the filesystem without any questions by using the force option (`-f`/`--force`). This option will remove all the Netdata assets in a **non-interactive** mode.
72
+ If you are sure and you know what you are doing, you can speed up the removal of the Netdata assets from the
73
+ filesystem without any questions by using the force option (`-f`/`--force`). This option will remove all the
74
+ Netdata assets in a **non-interactive** mode.
75
76
```sh
77
${NETDATA_PREFIX}/usr/libexec/netdata/netdata-uninstaller.sh --yes --force --env <environment_file>
@@ -58,9 +86,7 @@ chmod +x ./netdata-uninstaller.sh
86
./netdata-uninstaller.sh --yes --env <environment_file>
87
```
88
61
-The default `environment_file` is `/etc/netdata/.environment`.
89
+The default `environment_file` is `/etc/netdata/.environment`.
90
91
> Note: This uninstallation method assumes previous installation with `netdata-installer.sh` or the kickstart script.
64
-> Currently using it when Netdata was installed by a package manager can work or cause unexpected results.
65
-
66
-
92
+> Using it when Netdata was installed in some other way will usually not work correctly, and may make it harder to uninstall Netdata.