The Scalyr agent doc includes a section for uninstalling the Scalyr agent. Users who have tried the instruction may notice that the agent config file
/etc/scalyr-agent-2/agent.jsonisn't removed upon completion of the uninstall. This is an expected behavior due to that by default, package manager remove will (intentionally) leave config files in place. To fully remove everything, users need to use the package manager purge option.
Upon completion of Scalyr agent installation, there should be 3 directories created
/var/lib/scalyr-agent-2(state files, checkpoints)
/usr/share/scalyr-agent-2(actual source code) and symlinks to the binary in
Regular package manager remove (non-purge) should clean everything, but leave /var/lib and /etc/ directory in place. To clean up config files, users need to execute "purge" against the Scalyr agent.
sudo scalyr-agent-2 stop sudo apt-get purge scalyr-agent-2 -y sudo apt-get purge scalyr-repo -y rm -Rf /etc/scalyr-agent-2/ rm -Rf /var/lib/scalyr-agent-2/ rm -Rf /var/log/scalyr-agent-2/ rm -Rf /usr/share/scalyr-agent-2/