How to delete one out of two admin accounts?

I recently installed Kubuntu 16.04 on a new laptop. Because of some confusion, I created an admin account with my real name. I then created another admin account with a less personal name. I now want to get rid of (delete) the first admin account.

I went into Kubuntu's User Accounts GUI. There, I could remove admin privileges easily from the account I want to delete. But then when I actually tried to delete the user, I got this response:

Kubuntu User Accounts warning

Why does the system claim that the other user "is using the system right now" when that isn't true?

Is there a safe way to delete the other user? A terminal-based solution is welcome.

3

1 Answer

The userdel command has a -f option to force delete the user, so typing

userdel -f *Name*

should delete it.

If that does not work, edit /etc/passwd with your favorite text editor. You should find something like

root:x:0:0:root:/root:/bin/bash
m:x:0:100::/home/m:/bin/bash

(there are many more entries) now search for the user you want to delete. Once found, change the first 0 to another number. This is the UID of the User, and the UID 0 represents root. Once changed you can just use

deluser *Name*

to delete it.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like