Update Ubuntu using command

Launch the terminal program.
Connect to a remote server, using ssh.
Run the following command to obtain a list of updated software.

sudo apt-get update

Run the following command to update Ubuntu software/packages.

sudo apt-get upgrade

Finally, use the following command to restart the Ubuntu machine.

sudo reboot