This should attempt to install all available updates, and will log errors to /var/log/install.log
sudo softwareupdate --dump-state -i -a
IT
This should attempt to install all available updates, and will log errors to /var/log/install.log
sudo softwareupdate --dump-state -i -a