Article overview

Help article

Updating Ubuntu

Debian uses packages that are included in repositories to manage the updates and upgrades of your Debian installation / installed software. In this article, we show you how to update all packages on your Ubuntu 18.04 or newer VPS, update specific software, and update your entire OS to a newer version.

  • Connect to your VPS via SSH, or the VPS console before executing the commands below, and follow the steps as root user or use sudo
     
  • Restart your VPS after updating the kernel. Changes are often not processed until your server is restarted.

Updating all software / packages

 

With the command below, you update & upgrade all software on your VPS. This is a two-part process:

  • update: Update the list of available packages and versions thereof on your VPS. This is not done automatically by your OS and is therefore important to be able to install new software.
  • upgrade: Installs available updates of installed packages.
apt -y update && apt -y upgrade

-y confirms that this process may make changes to your VPS. Alternatively, you can also run these commands separately, i.e.:

apt -y update
apt -y upgrade

Updating specific software / packages

 

Would you rather update a specific package instead of all packages? Then, use the command:

apt -y update && apt -y upgrade packagenaam

Replace 'package name' with the name of the relevant package. In our article 'Installing software in Ubuntu 18.04', we explain how to find out the name of packages.


Upgrading Ubuntu

 

Check the installed version of Ubuntu with the command:

lsb_release -a

On Ubuntu's release page, you'll find the current release number. If an update is available, you can use the commands below:

Suppose you want to upgrade Ubuntu 18.04 to 20.04, then use the commands below.

apt -y update && apt -y dist-upgrade

or

apt -y update
apt -y dist-upgrade

The difference with the previous commands is that 'dist-upgrade' also adjusts dependencies in addition to the regular upgrade. Suppose a conflict occurs, an important package is then updated at the expense of less important packages.

This process is not entirely without risk and it is therefore important to restart your VPS after executing these commands to exclude whether problems have arisen, and if so, to restore one of the automatic backups of your VPS.

Has this article been helpful?

Create an account or log in to leave a rating.

Comments

Create an account or log in to be able to leave a comment.