From d27a28178302773a2b388bcffcd8550d1e244159 Mon Sep 17 00:00:00 2001 From: "Igor B. Poretsky" Date: Thu, 27 Nov 2025 19:47:55 +0300 Subject: [PATCH] Correct user deletion with all its data (#7368) Actually it is not necessary to remove particularly the local-ai data directory before user deletion. It will be accomplished automatically by the userdel command. But it is crucial to remove additional users from the local-ai group to allow userdel command to delete the group itself. --- docs/static/install.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/docs/static/install.sh b/docs/static/install.sh index 7241561a8..94cccd2e8 100755 --- a/docs/static/install.sh +++ b/docs/static/install.sh @@ -137,15 +137,10 @@ uninstall_localai() { fi done - # Remove models directory - if [ -d "/var/lib/local-ai" ]; then - info "Removing LocalAI data directory..." - $SUDO rm -rf /var/lib/local-ai - fi - - # Remove local-ai user if it exists + # Remove local-ai user and all its data if it exists if id local-ai >/dev/null 2>&1; then - info "Removing local-ai user..." + info "Removing local-ai user and all its data..." + $SUDO gpasswd -d $(whoami) local-ai $SUDO userdel -r local-ai || true fi