Resetting PRAM through Terminal

high sierrakeyboardnvramrebootterminal

For some reason, my Mac won't let me reset my PRAM in the usual way (by holding the relevant keys down when restarting), simply nothing happens when I try it and my Mac just boots up normally every time.

I'm suspecting this may be due to the fact I'm using a PC keyboard after I broke my Apple one a while back.

I read that I can reset my PRAM through Terminal with the following command:

sudo nvram boot-args=”-p -r”

But all I get is this error:

nvram: Error setting variable – 'boot-args': (iokit/common) general error

I'm running High Sierra on a late 2009 iMac if that helps

Best Answer

According to an Apple Support page called "Prepare your institution for iOS 10 and macOS Sierra":

...you must use the nvram command to properly set boot-args NVRAM variable. Starting with macOS Sierra, you must be booted to the recovery partition to run this command.

But now you can clear the NVRAM with

sudo nvram -c

Then restart for the reset to take effect.

I also have a PC keyboard that doesn't seem able to reset the NVRAM on startup, but I think the real problem is that it's wireless. But this command is easier and more reliable anyway.

Related Question