Update Ubuntu from the Command Line
To update your Ubuntu using the command line or terminal, type:
This will retrieve the new lists of packages, including any that were updated since you last ran the command. Next, run this command:
This will actually upgrade all the packages on your system that have an update available.