Laptop displaying Ubuntu system update errors next to troubleshooting workflow icons.
By velanitsupport / Sep 22, 2026

What are the typical reasons for getting Ubuntu APT update and upgrade errors?

Ubuntu’s APT is a set of tools used to manage software packages on the OS. It enables Linux admins to do everything from installing and updating to upgrading and removing packages. 
Sometimes errors occur when running Ubuntu upgrade commands.

General causes for Ubuntu upgrade errors

  • Corrupted package indexes
  • Unresolved dependency chains
  • Stale lock files 
  • Insufficient disk space
  • Partially configured packages from interrupted updates.

Finding the reason behind an Ubuntu update or upgrade failure might be made easier by a methodical troubleshooting procedure. The right diagnostic steps can resolve common Ubuntu update and upgrade errors.

While using sudo apt-get upgrade, the package management tool conducts a dependency resolution check for the local package cache. If it is found to be stale or damaged or does not match the configured repositories, APT may fail to find a consistent set of packages.

For package management, APT uses dpkg. If an update gets interrupted, then dpkg may leave packages in a half-installed state or trigger awaiting. These unfinished packages make APT unable to continue with upgrades until those issues are resolved.

This article covers Ubuntu LTS update and upgrade troubleshooting, with major release upgrades:

  • Ubuntu 20.04 LTS to 22.04 LTS
  • Ubuntu 22.04 LTS to 24.04 LTS
  • Ubuntu 24.04 LTS to 26.04 LTS. 

Step 1: Refresh the package index

Step 2:

“`bash

sudo apt-get update

sudo apt-get upgrade

“`

Step 3: For additional dependencies and to remove conflicting packages

“`bash

sudo apt-get dist-upgrade

“`

Step 1: Use the command

“`bash

sudo apt-get install -f

“`

Here -f tells APT to fix broken dependencies.

Step 2: Packages from third-party sources may need older or specific versions. These versions may conflict with newer versions in the official Ubuntu repositories.

 You can identify these packages with:

“`bash

apt-cache policy <package_name>

dpkg -l | grep “^ii” | grep -v “^ii lib”

“`

Compare the candidate version with the installed version. It is possible that a pinned package has an out-of-date candidate version. You might need to uninstall a package if it creates conflicts.

Step 1: To resolve ‘half-installed’ or ‘half-configured’ in the dpks’s state database. 

“`bash

sudo dpkg –configure -a

“`

Step 2: Update the package index and enter

“`bash

sudo apt-get update && sudo apt-get upgrade

“`

Step 1: If a process holding a lock crashes or stops unexpectedly, the lock file may remain on the disk itself. APT commands may fail with the error message 

“`

D: Could not get lock /var/lib/dpkg/lock-frontend – open (11: Resource temporarily unavailable)

“`

Step 2: Make sure that no process currently uses the file before removing it.

“`bash

sudo lsof /var/lib/dpkg/lock-frontend

sudo lsof /var/lib/dpkg/lock

sudo lsof /var/cache/apt/archives/lock

“`

Step 3: If there is no output, then you can remove the stale file using the command

“`bash

sudo rm /var/lib/dpkg/lock-frontend

sudo rm /var/lib/dpkg/lock

sudo rm /var/cache/apt/archives/lock

sudo dpkg –configure -a

sudo apt-get update

“`

Step 1: Verify current disk usage using the commands:

“`bash

df -h

“`

Step 2: Now, you need to check what elements are consuming space in `/boot`:

“`bash

du -sh /boot/*

ls /boot/vmlinuz-*

“`

Step 3: Systematic space recovery procedure:

“`bash

sudo apt-get autoremove –purge

sudo apt-get clean

sudo apt-get autoremove –purge

“`

Step 4: To manually remove old kernels, find currently running kernel:

“`bash

uname -r

“`

Step 5: Display the installed kernel list and remove old ones:

“`bash

dpkg -l ‘linux-image-*’ | grep ‘^ii’

sudo apt-get purge linux-image-X.X.X-XX-generic

“`

Replace the version string with the version of an older kernel. Be sure that you are not using the current kernel name.

Step 1: To remove orphaned packages and accumulated caches, use

“`bash

sudo apt-get autoremove

sudo apt-get autoclean

sudo apt-get clean

“`

Step 1: When apt-get upgrade shows conflicts with specific packages, use 

“`bash

sudo apt-get upgrade –fix-missing

“`

With this, the APT skips packages that cannot be accessed while upgrading the rest. It can help when a single unavailable package is preventing the entire upgrade.

Step 2: A specific conflicting package can be removed and reinstalled using

“`bash

sudo apt-get remove –purge <package_name>

sudo apt-get install <package_name>

“`

Step 3: Generally, when APT encounters a conflict, the package name will be displayed in the error message. If you want to confirm the package name, use

“`bash

apt-cache show <package_name>

apt-cache depends <package_name>

apt-cache rdepends <package_name>

“`

Step 1: Using “apt-get dist-upgrade” alone is not sufficient for an Ubuntu major release upgrade.

Use this procedure

“`bash

sudo apt-get update

sudo apt-get dist-upgrade

sudo apt-get autoremove

sudo do-release-upgrade

Server considerations when using do-release-upgrade

If you run the upgrade on a server through SSH, use tmux or screen. This keeps the upgrade running if the SSH connection is lost.

Use -d only when upgrading to a development release. Do not use it on production servers.

The tool may ask you to review changes to configuration files. Review these changes carefully before choosing an option.

Step 2: Open a persistent session before the upgrade using

“`bash

tmux new -s upgrade

sudo do-release-upgrade

“`

Third-party PPAs or repositories can sometimes cause update errors such as

“`

D: The repository ‘http://ppa.launchpad.net/…’ does not have a release file.

“`

D: The repository ‘http://ppa.launchpad.net/…’ does not have a release file.

“`

Step 1: To get a list of all configured repositories:

“`bash

ls /etc/apt/sources.list.d/

cat /etc/apt/sources.list

“`

Disable PPAs

Before disabling a Personal Package Archive, make a backup of its repository file. Then comment out the PPA entry instead of deleting it. This lets you restore it after the upgrade.

You can list the PPA files with:  ls /etc/apt/sources.list.d/

Step 2: To disable a PPA

Open .list file 

Add # at the beginning of the repository line. 

run sudo apt-get update

Step 3: After the Ubuntu upgrade is complete, check whether the PPA supports the new release. Re-enable it only if a compatible repository is available.

“`bash

sudo add-apt-repository –remove ppa:<ppa_name>/<ppa_name>

“`

Some update errors are caused by running processes rather than disk problems. For example, a service may be using a library that APT needs to replace. A kernel module may also conflict with a newly installed version.

Step 1:

“`bash

sudo reboot

“`

Step 2: After reboot, the system will be in a clean state, and you can try running the full update procedure.

“`bash

sudo apt-get update && sudo apt-get upgrade

“`

Step 3: If you are doing it on a remote server, then use `needrestart`. This is helpful to avoid a full system reboot by spotting the affected services that need restarting.

“`bash

sudo apt-get install needrestart

sudo needrestart

“`

  • Run sudo apt-get update && sudo apt-get upgrade at least once a week on production systems.
  • Track  /, /boot, and /var. Set an alert when disk space usage reaches around 85%.
  • Review third-party Personal Package Archives before starting a major Ubuntu upgrade.
  • Run major upgrades inside tmux or screen when working on remote systems.
  • Take a full backup or system snapshot before running do-release-upgrade.
  • Test the upgrade process in a staging environment before production systems.

For shared hosting environments and multi-tenant application servers:

  • Maintain a documented upgrade runbook with pre-upgrade verification steps.
  • Include clear rollback procedures in case the upgrade fails.
  • Perform tests to confirm that services are working correctly.

Quick Overview

Error MessagePrimary FixRoot Cause/Next Action
“404 Not Found” for package URLs`apt-get update`Stale package index
“Unmet dependencies” or “held broken packages”`apt-get install -f`Broken/unmet dependencies
Could not get lock /var/lib/dpkg/lockManually remove lock filesStale lock file
No space left on deviceFree space on root partitionInsufficient disk storage space
dpkg was interrupted`dpkg –configure -a`Package configured partially
Could not get lockCheck `lsof`, remove stale lock files`dpkg –configure -a`
Unmet dependencies`apt-get install -f``dpkg –configure -a`
No space left on device`apt-get autoremove –purge && apt-get clean`Remove old kernels manually
dpkg was interrupted`dpkg –configure -a``apt-get update && apt-get upgrade`
“404 Not Found” for packages`apt-get update` (check mirror availability)Disable broken PPAs
held broken packages`apt-get dist-upgrade –dry-run`Reinstall or remove conflicting package
SSH drop during upgradeReconnect and attach to `tmux`/`screen` session`dpkg –configure -a` if session was lost
What is the reason for “do-release-upgrade” failure?

Your system has unresolved dependencies or packages.
Update the system and remove unused packages. 
Check whether third-party PPAs are disabled or support the new Ubuntu release.

How much free disk space is usually needed for a major Ubuntu upgrade?

The required space depends on the packages installed on your system.
Keep at least 2–3 GB free on / and 200–300 MB free on /boot. 
If space is limited, run sudo apt-get autoremove –purge followed by sudo apt-get clean.

What gets automatically updated in Ubuntu?

Security fixes automatically install in the background without user interaction.
Non-security updates usually require manual approval or configuration changes.
Major OS versions never upgrade automatically.

Categories

Contact for a Free Consultation