MacOS – sudo: setrlimit(8): Invalid argument after switching Mac OS shell from BASH to ZSH

bashcommand linemacossudozsh

After updating to Mac OS Catalina some months ago, I followed the prompted suggestions and changed my shell from BASH to ZSH.

Since that time, whenever I use sudo in Terminal, I get sudo: setrlimit(8): Invalid argument. The sudo'd command runs fine, but this error shows every time.

I don't have any plugins or modifications to my shell – it's vanilla ZSH in default Terminal.app

I've searched the Googs but I can't really find anything that seems like a good match – only generic "increasing limits on sockets in osx". I could try that, but I don't understand why I should be having an issue in the first place when I have not and do not doing anything peculiar or fancy with shell – I use it for git, npm and occasionally other commands.

Does anyone have any ideas? Not sure what other information you'd need, but let me know if there is.

Best Answer

I had this message as well.

I think I've might have worked out a solution to it.

Check which version of sudo you have installed with sudo -V and if it isn't 1.8.31 download the newest version from here GitHub You'll have to download this one here "sudo-1.8.31.mac1015.pkg"

Let me know if it worked out for you!