Overview ๐ฅ
In some scenarios, partners may need to fully remove the Liongard Agent from a Linux systemโfor example, when migrating servers, performing a clean reinstallation, or troubleshooting agent behavior.
While a simple uninstall removes the primary binary and service, residual files such as systemd timers, cached installers, or leftover directories may still remain on the system. This article provides a step-by-step, verified method to completely remove the Liongard Agent and its components, ensuring your environment is clean and ready for reinstallation if needed.
Why Perform a Full Cleanup? ๐ค
A complete cleanup is recommended when:
The agent fails to check in or becomes stuck in an incorrect state.
You need to reinstall the agent for a different environment or tenant.
Old service entries or cached installers interfere with upgrades.
You want to ensure no residual processes or security risks remain.
Performing a thorough removal ensures there are no orphaned systemd services, no background update timers, and no mismatched agent metadata left behind.
Step-by-Step Uninstallation ๐งโ๐ซ
Step | Command | Description | Expected Outcome |
1 |
| Stops the running Liongard Agent service before removal. | Service transitions to inactive (dead). |
2 |
| Disables auto-start of the agent on boot. | Unit file link removed from |
3 |
| Stops the updater service to prevent background triggers. | Updater process stopped. |
4 |
| Disables the updater timer. | Timer disabled from scheduled runs. |
5 |
| Removes systemd service and timer definitions. | Removes service and timer unit files. |
6 |
| Deletes the agent installation directory. | Folder |
7 |
| Removes Liongard data or state files. | Cleans up stored metadata or logs. |
8 |
| Removes remaining system-wide service files. | System-level definitions removed. |
9 |
| Reloads systemd to remove stale unit entries. | Systemd daemon refreshed. |
Verify Complete Removal ๐
After cleanup, confirm no Liongard components remain:
sudo find / -iname "*liongard*" 2>/dev/null
โ Expected Output:
No paths returned (indicating all files and services are removed).
If you still see files like:
/usr/lib/systemd/system/liongard-agent-updater.service
/run/systemd/propagate/liongard-agent.service
/LiongardAgent-lts-x64.xz.run
โ remove them manually using sudo rm -f <path>.
โ Delete the agent from the Liongard portal:
Login to Liongard โ Admin โ Agents
Locate the agent in question
You can remove it using either of the following methods:
Click on the three dots (โฎ) next to the agent and select Delete Agent, or
Select the agent โ Click on the Action tab โ Choose Delete Agent(s)
โ Optional: Clean System Journal Entries
To clear out residual logs related to Liongard:
sudo journalctl -u liongard-agent.service --rotate --vacuum-time=1d
sudo journalctl -u liongard-agent-updater.service --rotate --vacuum-time=1d
(This keeps only the last day of logs and helps declutter your journal.)
Security Considerations ๐
Area | Risk | Why Cleanup Matters | Best Practice |
Residual Services | Orphaned services could attempt network calls. | Prevents unauthorized traffic or stale agent heartbeats. | Always disable and remove systemd entries. |
Stale Credentials | Cached keys or secrets may remain in | Could pose data exposure risk in shared environments. | Securely wipe |
Agent Collision | Reinstalling without cleanup can reuse stale identity. | May overwrite previous agent in Liongard dashboard. | Clean before reinstall to ensure unique agent ID. |
System Integrity | Incomplete uninstall can affect package updates. | Maintains clean dependency graph for Linux package manager. | Verify via `systemctl list-units |
Reinstalling After Cleanup ๐จโ๐ป
If you plan to reinstall:
Reboot the system (optional).
Download the latest Linux installer from your Liongard instance.
Run the install command with proper
LIONGARDURL,ACCESSKEY, andACCESSSECRET.Confirm the agent registers as a new device in the portal.
For detailed installation steps, see:
๐ Deploying Liongard Agent on Linux
Need Assistance? ๐ฆ
Our Support team is happy to help with agent cleanup or verification.
๐ฌ Start a chat with Leo (AI Assistant) or connect with a live support engineer.
๐ง Email: support@liongard.com