Reputation: 1007
I have a .mpkg file which i want to execute from the terminal I sucessfully used this command to achive this
sudo installer -pkg Snip.mpkg -target /Applications
But the thing is that when i run this command it ask me for the admin password before performing the installation. Is there a way i can do this without the password or can i provide the password also in my sudo installer command...
Also see :- Running .pkg on MAC OS from java code
please reply
thanks in advance
Upvotes: 7
Views: 26448
Reputation: 34677
Remove the password requirement from sudo using the following line in sudoers:
jinith ALL=(ALL) NOPASSWD: ALL
Do note the other solution will add the password to the process list. Mine will make it so that user jinith can run any command as any user without a password.
Upvotes: 2
Reputation: 3375
You should be able to pass in the password from stdin
:
echo <password> | sudo -S installer -pkg Snip.mpkg -target /Applications
Upvotes: 0