This error message occurs when you try to delete a user account that is still being used by a running process. To resolve this issue, you need to first identify the process using the user account and then stop it before deleting the user account.
Here is the process to resolve the error:
-
Identify the process using the user account:
- Run the following command to list all processes running under the user account:
ps -u vivek
- Replace “vivek” with the name of the user account you want to delete.
- Run the following command to list all processes running under the user account:
-
Stop the process:
- Identify the process ID (PID) of the process and then stop it using the following command:
kill -9 PID
- Replace “PID” with the actual process ID.
- Identify the process ID (PID) of the process and then stop it using the following command:
-
Delete the user account:
- Finally, run the following command to delete the user account:
userdel vivek
- Replace “vivek” with the name of the user account you want to delete.
- Finally, run the following command to delete the user account:
Now the user account should be deleted successfully.