Nicl: command not found (how to replace it? trying to erase user)

Discussion in 'Mac Programming' started by sun surfer, Jul 19, 2013.

  1. sun surfer macrumors regular

    Jun 6, 2010
    Hi, I've erased my MacBook Pro, re-installed the Snow Leopard OS X and added some applications with a temporary user and am attempting to erase that user so the computer will be "like new". I don't know a lot about this stuff but I found these instructions for the end:

    Software must be installed into root level applications folder (/applications and not ~/applications).
    Reboot and hold down command-s.
    /sbin/fsck -y
    /sbin/mount -uw /
    Then to delete user account used to install applications:
    rm -r /Users/[user's short name]
    nicl -raw /var/db/netinfo/local.nidb delete /users/[user's short name]
    Then to make machine start set-up assistant again:
    rm /var/db/.AppleSetupDone
    Then to shut down:
    shutdown -h now
    Everything worked fine except the line beginning with "nicl". That line brought the response "-sh: nicl: command not found".

    I started the machine up again and there was no user, so I created a new one and tried it all again with the new user, and the same thing with the "nicl" line. Again I started it and there was no user, so I'm thinking the line above the "nicl" might erase the user from sight, but the "nicl" line that's actually supposed to erase the user isn't working so those users I've created might be hiding somewhere.

    I googled and found that "nicl" and "netinfo" might only work on Leopard and earlier, and that "dscl" might replace it.

    How would the line be written with "dscl" instead to make it work to erase a user, or is there some other command that would work?
  2. lee1210 macrumors 68040


    Jan 10, 2005
    Dallas, TX
    nidb appears, but not nicl. Are you manually typing commands?

  3. chrfr macrumors 604

    Jul 11, 2009
  4. sun surfer thread starter macrumors regular

    Jun 6, 2010

    Yes, I'm typing commands into the "root" screen, I think it's called? I restart with command-s and it takes me to a terminal-like black screen where I type in commands.


    Thanks! That's the type of thing I was looking for. I will try it and hopefully it all works, and I guess I'll have to try it for all the usernames I created to make sure they're all gone even though they seem disappeared for now.
  5. sun surfer thread starter macrumors regular

    Jun 6, 2010
    OK, that link to new directions is not working correctly.

    First of all, all its directions start with "$". Why is this? Do I have to put those in? I'm assuming not because I've seen similar directions without the "$". My screen doesn't show a "$" to start every line but rather something that includes the word "root".

    OK, the first problem from that link is with this command:

    $ launchctl load /System/Library/LaunchDaemons/
    My computer says something like that is not found and that I should instead use something very similar but with something like "" instead, followed by "localonly" or something. So I did, and this still said nothing was found but now took me out the line where it always began with "root" something and to a line that only begins with ">".

    I then tried the next line of command:

    $ dscl . -read /Users/USERNAME GeneratedUID
    and all it does is give me this really long list of possible commands to use (so long the top is cut off by the screen and I have no idea how to scroll up to see the top).

    So that's where I'm stuck at now. I read some of the comments from the link before trying and they all say how it works well if they used it, so how is this happening to me? I'm following the instructions closely and wrote everything exactly as told to do.

    ETA - That link mentions Lion and Mountain Lion. I assumed since chrfr linked me and since Snow Leopard is included with those as the "post-nicl" os xs, that they would work the same way with Snow Leopard. But now I'm wondering if those commands are only for Lion/Mountain Lion. If so, what will work for Snow Leopard?
  6. ArtOfWarfare macrumors G3


    Nov 26, 2007
    $ or > are commonly used to represent prompt, which may look like whatever you program it to look like.

    The default shell in Terminal is, I think, Bash, which normally includes the user name, the current directory, and a > in the prompt.
  7. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
    Don't type the $ .

    When they show the $, that's the prompt. You're supposed to type what comes after the $ .

    When you say "I found instructions ..." it's always a good idea to post where you found them. That is, post the exact URL of what you're referring to.

    Like if you said "I read in a book ...", it's a good idea to tell us what the title and author of the book is. So we're all reading from the same book.


    No, the default prompt contains name, directory, and $ as the end of the prompt.

    The > prompt means a continuation line, like an unclosed quote, or a previous line ending with backslash-newline.

    And the default prompt when running as the root user is # .
  8. sun surfer thread starter macrumors regular

    Jun 6, 2010

    Thanks for the "$" explanation.

    I honestly don't know where I found those instructions. Days ago I went looking for instructions on the entire process of erasing a computer to make it like new, and those were just one. I copied and pasted them into a Pages document along with others, then decided to use those for the endgame because they were a way to add back the applications and still have the laptop start like new. I just now tried googling for them using some of the commands in quotations but it's not showing up on google so I don't know. But suffice it to say, I copied the important parts here, and they all worked except that one line, and it's already been established that the one line is too old, from 10.4 and before while I'm using 10.6. So now the issue is finding some other commands to work.

    However, the instructions I was just trying today that aren't working were from the link that chrfr gave me above from the macworld article. Those aren't working right but they're way too long to copy and paste in full so you can click on the link to see the full instructions I was working from, but I did paste the relevant commands when they stopped working. My guess is that the problem is that those instructions are for 10.7 and above, while the old instructions from the first post of mine are from 10.4 and below, which basically leaves correct instructions for my 10.6 in the dust.

    I went searching some more and did finally find this not long ago:

    Specifically the last post there (4), which is apparently some instructions for the same thing for 10.6. I just tried them and they sort of seem to work. But I've already done so much other, I'm not sure (like some things were already erased beforehand). The "launchctrl" command worked properly

    $ /bin/launchctl load /System/Library/LaunchDaemons/
    unlike with the linked instructions from chrfr.

    And then this command seemed to work the first time:

    $ dscl . -delete /Groups/admin GroupMembership <username>
    Which is good, since I used the username of one of the users that had "disappeared" using the directions in my first post, so it was good to know it was hiding somewhere and is now gone.

    However, when I tried it for the other users, it didn't work, just saying the directory is already loaded. So my best guess is that hopefully, that command erased all the admin users and not just the one username I added at the end of the line.

    I did run this line first too from the last link:

    $ rm -R /Library/Preferences/
    Which wasn't in either of the other sets of directions. Hopefully it won't mess anything up; I'm just guessing it's erasing library preferences in case I set any while using a temporary user to install applications.

    So, basically, I'm still sort of lost as to what to do exactly with all these competing instructions and none working exactly right, but the feeling I'm getting is that maybe I've now done enough and basically the users are deleted and it's good to go?
  9. chrfr macrumors 604

    Jul 11, 2009
    I dug out my own notes on this. Your guess is correct:
    /System/Library/LaunchDaemons/ is on Leopard and Snow Leopard while Lion and later use /System/Library/LaunchDaemons/

    So for Leopard and Snow Leopard, do the following:
    First, boot into Single User Mode. Then type each of the following lines into the prompt.
    mount -uw /
    rm -R /Library/Preferences
    rm -R /Users/username/
    rm /var/db/.AppleSetupDone
    /bin/launchctl load 
    /System/Library/LaunchDaemons/ &
    dscl . -delete /Users/username
    dscl . -delete /Groups/admin GroupMembership username
    shutdown -h now
  10. sun surfer thread starter macrumors regular

    Jun 6, 2010
    Thanks chrfr. That's similar to what I did from the last link I included and now when I try it, it's acting like there is nothing there to delete at that part. Iinstead of seeming to run the delete commands, it's just saying that the directory is already loaded so I'm assuming that means there's nothing there to delete now?
  11. chrfr macrumors 604

    Jul 11, 2009
    If you've already loaded Directory Services and haven't rebooted since, you do not need to reload it. With Directory Services loaded, you can type the following to see if that user is there. You will get a long list of names but near the bottom would be the accounts you created.
    dscl . -list /Users

Share This Page