This post contains affiliate links, marked with . This means, if you make a purchase through such a link, I may earn a small commission at no extra cost to you. For more information, click here.

Using a DigitalOcean Droplet to run this Ghost Blog, I am in the need to update Ubuntu from time to time. Here is how to do this in a terminal prompt using the command line.

The Ubuntu update command is apt, or apt-get. Apt is Ubuntu's primary package manager. Using the update option tells apt to search your software repositories and take note of the packages with available updates. You might see some guides telling you to use apt-get instead of apt. Don't be confused: both commands perform the same function, apt is just a bit more user-friendly.


Advertisement

First we need to log into the Droplet we created earlier using root@167.172.228.71, if you set up OpenSSH alongside, you log in without a need of a password.

Next we use sudo apt update. Once the update command has completed, you'll be ready to apply the package updates using the upgrade option: sudo apt upgrade. After listing out the available upgrades, we will be asked to confirm the installation by entering y or yes.

The upgrade command will apply all upgrades found in the previous update command, as long as they don't require removal of any installed packages. If some packages refuse to upgrade, we can use the full-upgrade option instead, which should resolve the problem.

We can combine both update and upgrade into one command by utilizing the && operator and skip the confirmation by adding the -y flag to the end of the  command.

sudo apt update && sudo apt upgrade -y

DigitalOcean – The developer cloud
Helping millions of developers easily build, test, manage, and scale applications of any size – faster than ever before.