Method 1: Update Ubuntu via the Command Line
First, open the terminal in Ubuntu desktop. You can find it in the menu, or use the Ctrl+Alt+T keyboard shortcut. If you are logged on to an Ubuntu server, you already have access to a terminal.
In the terminal, you just have to use the following command:
sudo apt update && sudo apt upgrade -y
It will ask for a password. You can use your account’s password. You won’t see characters on the screen while typing password in the terminal, so keep on typing your password and hit enter. This will update the packages in Ubuntu.
See, how easy it is to update Ubuntu from terminal? Now let me explain the above command.
It’s actually not a single command, it’s a combination of two commands. The && is a way to run multiple commands in Linux in a way such that the second command runs only when the previous command ran successfully.
The “-y” in the end automatically enters “yes” when the command “apt upgrade” ask for your confirmation before installing updates.
Note that you can also use the two commands separately, one by one:
sudo apt update
sudo apt upgrade
It will take a little longer, because you have to wait for one command to finish and then enter the second command.