This guide explains how to safely remove CHV packages while preserving or deleting data.
The default package removal intentionally preserves all persistent state. This prevents accidental data loss.
sudo dpkg -r chv-node chv-controlplane chvctl
sudo apt-get autoremovesudo rpm -e chv-node chv-controlplane chvctlAfter standard removal, the following remain on disk:
| Path | Contents | Preserved? |
|---|---|---|
/var/lib/chv |
SQLite database, agent cache, storage volumes, images | ✅ Yes |
/etc/chv |
Configuration files (*.toml, certs, bootstrap token) |
✅ Yes |
/var/log/chv |
Service logs | ✅ Yes |
chv user and group |
System user | ✅ Yes |
| Path | Contents | Removed? |
|---|---|---|
/usr/bin/chv* |
Binaries | ✅ Yes |
/lib/systemd/system/chv-*.service |
Systemd units | ✅ Yes |
/usr/share/chv |
UI assets, migrations | ✅ Yes |
# Binaries should be gone
which chvctl # should return nothing
which chv-agent # should return nothing
# Data should still exist
ls -la /var/lib/chv # should show contents
ls -la /etc/chv # should show contents
# User should still exist
getent passwd chv # should show chv user
getent group chv # should show chv groupBecause data is preserved, you can reinstall CHV and resume operation:
# Debian/Ubuntu
sudo dpkg -i chv-controlplane_0.1.0_amd64.deb chv-node_0.1.0_amd64.deb chvctl_0.1.0_amd64.deb
# RHEL/Rocky/Alma
sudo rpm -i chv-controlplane-0.1.0-1.x86_64.rpm chv-node-0.1.0-1.x86_64.rpm chvctl-0.1.0-1.x86_64.rpm
# Start services
sudo systemctl daemon-reload
sudo systemctl enable --now chv-controlplane chv-agent chv-stord chv-nwdYour previous database, caches, and configs will be intact.
⚠️ WARNING: This procedure permanently destroys all CHV data. Back up anything you need before proceeding.
sudo systemctl stop chv-controlplane chv-agent chv-stord chv-nwd# Debian/Ubuntu
sudo dpkg -r chv-node chv-controlplane chvctl
sudo apt-get autoremove
# RHEL/Rocky/Alma
sudo rpm -e chv-node chv-controlplane chvctlsudo rm -rf /var/lib/chv
sudo rm -rf /etc/chv
sudo rm -rf /var/log/chvsudo userdel chv
sudo groupdel chvsudo rm -rf /run/chvsudo systemctl daemon-reload
sudo systemctl reset-failedIf you plan to reinstall or migrate CHV, back up these paths before removal:
# Back up everything
sudo tar -czf chv-backup-$(date +%Y%m%d).tar.gz /var/lib/chv /etc/chv /var/log/chvCritical files to back up:
/var/lib/chv/controlplane.db— control plane database/var/lib/chv/agent-cache.json— agent enrollment state/var/lib/chv/storage/— volume data and images/etc/chv/certs/— TLS certificates/etc/chv/bootstrap.token— enrollment token (if still needed)
If the chv user is still referenced by running processes:
# Find and stop any lingering processes
sudo ps aux | grep chv
sudo kill -9 <pid>
# Retry user deletion
sudo userdel chvIf files in /var/lib/chv are locked by a kernel module or container:
# Check for open file handles
sudo lsof +D /var/lib/chv
# Unmount any bind mounts
sudo umount /var/lib/chv/* 2>/dev/null || true- Debian / Ubuntu Install
- RHEL / Rocky / AlmaLinux Install
- Package Contract — formal rules for package behavior