Stop the service

Uninstall the app (doesn't delete the existing install package)

Reinstall the app from the cached install package


systemctl stop postgresql@9.6-protect.service

apt-get remove unifi-protect

apt-get install unifi-protect