How to Update Ubuntu from Terminal

By
Marko Aleksic
Published:
December 11, 2025
Topics:

Keeping an operating system up to date ensures it always has the latest features and security patches. In Ubuntu, Software Updater is an application that checks for updates and provides a graphical interface to install them. However, using a terminal application to update via CLI is also possible.

This article will show you how to update Ubuntu from the terminal.

How to update Ubuntu from Terminal.

Prerequisites

  • Ubuntu installed.
  • Command-line access.
  • sudo privileges.

How to Update Using Terminal in Ubuntu

As a Debian-basedย Linux distribution, Ubuntu uses theย APT package managerย to install, update, and remove software packages via the command line. Below are two methods for updating Ubuntu with APT.

Method 1: apt upgrade

Execute the following steps to check for and install updates in Ubuntu:

1. Refresh the list of packages available in remote repositories with sudo apt update:

sudo apt update

If APT detects out-of-date packages on the local system, the output shows the number of them.

APT package manager output showing that 30 packages on the system can be upgraded.

2. Optionally, inspect upgradeable packages with the following command:

apt list --upgradeable

The command shows the list of packages that have newer versions available.

A list of upgradeable packages in Ubuntu.

3. Start the package upgrade process by typing:

sudo apt upgrade

When prompted, type Y and press Enter to update the current Ubuntu release with new packages.

Upgrading packages on Ubuntu with sudo apt upgrade.

Wait for the upgrade to complete. Once APT finishes, the Bash shell prompt returns.

Note: Type sudo apt update && sudo apt upgrade -y to perform the abovementioned actions in a single command.

Method 2: apt dist-upgrade

Before upgrading Ubuntu to a new release, ensure the system is up to date. While executing apt upgrade is usually enough, the recommended procedure is to use the apt dist-upgrade command, because it is specifically designed to handle changing dependencies that may be required when moving between major releases or upgrading the entire system.

Proceed with the steps below to update Ubuntu using apt dist-upgrade:

1. Refresh the repository package list:

sudo apt update

2. Execute the dist-upgrade command:

sudo apt dist-upgrade

Type Y and press Enter to start the upgrade.

Upgrading packages on Ubuntu with sudo apt dist-upgrade.

The command installs new packages, resolves dependencies, and performs package clean-up, preparing the system for the release upgrade.

3. Once the dist-upgrade is complete, initiate the release upgrade procedure by typing the following command:

sudo do-release-upgrade

Follow the prompts to upgrade Ubuntu to a new version.

Conclusion

This tutorial taught you how to update software packages on your Ubuntu system. It presented two update methods: one for performing everyday system updates and the other for preparing the system for a release upgrade.

If you are new to Ubuntu, read How to Install Wine on Ubuntu and start running Windows applications on Linux.

Was this article helpful?
YesNo