diff --git a/orbit/pkg/packaging/linux_shared.go b/orbit/pkg/packaging/linux_shared.go index 4f42cad20473..0e425790c72a 100644 --- a/orbit/pkg/packaging/linux_shared.go +++ b/orbit/pkg/packaging/linux_shared.go @@ -364,7 +364,9 @@ pkill fleet-desktop || true func writePostRemove(opt Options, path string) error { if err := ioutil.WriteFile(path, []byte(`#!/bin/sh -if [ "$1" = 0 ]; then +# For RPM during uninstall, $1 is 0 +# For Debian during remove, $1 is "remove" +if [ "$1" = 0 ] || [ "$1" = "remove" ]; then rm -rf /var/lib/orbit /var/log/orbit /usr/local/bin/orbit /etc/default/orbit /usr/lib/systemd/system/orbit.service /opt/orbit fi `), constant.DefaultFileMode); err != nil {