Upgrade Ubuntu From Terminal: APT vs do-release-upgrade for Updating Ubuntu

Upgrade Ubuntu From Terminal: APT vs do-release-upgrade for Updating Ubuntu

Use do-release-upgrade when moving to a new Ubuntu version, and use APT when updating packages inside your current version. That is the safe rule. Ubuntu LTS releases get five years of standard security maintenance, so you do not always need to jump versions the moment a new one appears [source: Ubuntu]. If you are on Ubuntu 22.04 LTS and want Ubuntu 24.04 LTS, reach for do-release-upgrade; if you only want newer browser, kernel, security, and library updates for 22.04, use APT.

TLDR: APT updates installed packages, while do-release-upgrade upgrades the operating system to a new Ubuntu release. For example, sudo apt update && sudo apt full-upgrade keeps Ubuntu 22.04 current, but sudo do-release-upgrade can move it to 24.04. In a small team with 25 Ubuntu laptops, weekly APT maintenance might take 5 minutes per machine, while a release upgrade can take 45 to 90 minutes and needs more checking. If uptime matters, use APT often and plan do-release-upgrade like a real maintenance job.

APT and do-release-upgrade are not rivals

All Heading

People often treat APT and do-release-upgrade like two competing ways to “upgrade Ubuntu.” That wording causes trouble. They do different jobs.

APT, short for Advanced Package Tool, works with packages from your configured software repositories. It downloads package lists, installs updates, resolves dependencies, removes obsolete packages when asked, and keeps your current Ubuntu release healthy.

do-release-upgrade is a higher-level tool. It changes your Ubuntu release itself. It edits software sources, checks upgrade rules, disables third-party repositories, calculates a large package transition, and moves the system from one Ubuntu version to another.

The catch is that both tools may display lots of scary package names. That makes them look more similar than they are. One is routine maintenance. The other is a controlled jump to a new base system.

When to use APT

Use APT for normal updates. This includes security patches, application updates, kernel updates, bug fixes, and dependency changes within the same Ubuntu release.

A typical APT update looks like this:

sudo apt update
sudo apt upgrade

The first command refreshes package information. The second installs available upgrades that do not require major package removals. For a fuller update, many admins prefer:

sudo apt update
sudo apt full-upgrade

full-upgrade can install new packages or remove old ones if needed to complete an upgrade. That makes it useful for kernel and system updates. It is also why you should read the summary before typing Y. If APT wants to remove half your desktop, stop and investigate.

APT is the right choice when you want to:

  • Install pending security updates.
  • Update Firefox, LibreOffice, system libraries, or the kernel.
  • Keep Ubuntu 20.04, 22.04, or 24.04 patched.
  • Install or remove software with apt install or apt remove.
  • Fix held packages or dependency problems.

Honestly, it feels like APT asks for attention at the worst possible time. You sit down to do one small task, and suddenly 287 packages are waiting. Still, those updates matter. Ignoring them for months is how small security gaps turn into ugly weekends.

When to use do-release-upgrade

Use do-release-upgrade when you are ready to move to a newer Ubuntu version. For example, from Ubuntu 22.04 LTS to Ubuntu 24.04 LTS, or from Ubuntu 23.10 to Ubuntu 24.04.

The basic command is simple:

sudo do-release-upgrade

On LTS systems, Ubuntu may wait until the first point release before offering the next LTS upgrade. That means an upgrade from one LTS to the next may not appear on day one. This is intentional. It avoids pushing cautious users into early upgrade bugs.

If the command says no new release is available, check the release prompt setting:

cat /etc/update-manager/release-upgrades

For LTS-to-LTS upgrades, you usually want:

Prompt=lts

For regular releases, use:

Prompt=normal

Do not change this randomly on a production machine. Pick a release strategy and stick with it.

The key difference: package upgrade vs release upgrade

APT stays inside the lines of your current Ubuntu version. If your system uses Ubuntu 22.04 repositories, APT pulls updates from those repositories. It will not magically convert the system into Ubuntu 24.04.

do-release-upgrade changes those lines. It moves package sources from one Ubuntu release to another. It also runs checks that plain APT does not. That includes upgrade eligibility, package transition rules, and prompts for obsolete packages.

Think of it this way:

  • APT is like servicing your car: oil, brakes, tires, filters.
  • do-release-upgrade is like replacing the engine and dashboard while keeping the same car.

Both are upgrades. Only one changes the machine in a deep way.

Best practice before any terminal upgrade

Before using either tool, especially do-release-upgrade, take a backup. Not a vague “I think my files sync somewhere” backup. A real one.

At minimum, back up:

  • Your home directory: /home/yourname
  • Server configs in /etc
  • Databases, such as PostgreSQL or MySQL dumps
  • Custom scripts and cron jobs
  • VM snapshots, if using a virtual machine

Also check available disk space:

df -h

A release upgrade can fail if the root partition is cramped. Expect to waste time on cleanup if / has only a few hundred megabytes free. Remove old kernels, clear cached packages, and delete junk first:

sudo apt autoremove
sudo apt clean

A safe APT update workflow

For routine maintenance, this sequence works well:

sudo apt update
apt list --upgradable
sudo apt full-upgrade
sudo apt autoremove

apt list --upgradable gives you a quick preview. It is not exciting, but it can save you from surprises. If you see database packages, display drivers, or core desktop components, consider updating when you have time to reboot.

After kernel updates, reboot:

sudo reboot

Yes, Linux can run for ages without rebooting. No, that does not mean the new kernel is active. Check with:

uname -r

A safe do-release-upgrade workflow

For a release upgrade, slow down. This is where patience pays off.

  1. Install all current updates with APT.
  2. Reboot into the latest kernel.
  3. Disable or review third-party repositories.
  4. Back up key data.
  5. Run sudo do-release-upgrade.
  6. Read prompts before accepting removals.
  7. Reboot and test the system.

Start with:

sudo apt update
sudo apt full-upgrade
sudo apt autoremove
sudo reboot

Then run:

sudo do-release-upgrade

On servers, run it inside a stable SSH session. Even better, use a terminal multiplexer:

sudo apt install tmux
tmux
sudo do-release-upgrade

If your SSH connection drops, tmux can save the day. Without it, you may find yourself staring at a frozen session, wondering if the system is upgrading or quietly suffering.

Common mistakes to avoid

  • Do not edit repository files manually unless you know exactly why. Replacing every codename with a newer one is not the same as a proper release upgrade.
  • Do not skip backups because “it worked last time.” That sentence has ruined many afternoons.
  • Do not run release upgrades over weak Wi-Fi. Use Ethernet or a reliable connection.
  • Do not ignore third-party PPAs. They can block upgrades or create dependency conflicts.
  • Do not upgrade right before a deadline. Give yourself a fallback window.

Which one should you choose?

Choose APT for weekly or daily care. It is the normal tool for keeping Ubuntu secure and current. If you run a desktop, use it whenever updates are available. If you run a server, put it into a repeatable maintenance routine.

Choose do-release-upgrade when your Ubuntu version is nearing end of support, when you need newer system components, or when your organization has approved a move to the next release. Treat it as a planned upgrade, not a casual command.

The simple rule holds: APT updates what you have; do-release-upgrade moves you to what comes next. Use both, but use them at the right time.