macOS software update from Terminal
macOS can update system software from Terminal, even macOS itself. However, to complete the upgrade requires using the graphical desktop, perhaps over VNC.
softwareupdate -lshows the available updates.
softwareupdate -i -ainstalls all available updates.