APT package installation commands like sudo apt install package-name return the “E: Unable to locate package” error when your system cannot find the requested package in its repository index. After upgrading to Ubuntu 24.04, this error often points to outdated package lists, missing repositories, or incorrect repository configurations.
Update Package Lists to Refresh APT Cache
Outdated or missing package lists are the most common reason for the “Unable to locate package” error after a system upgrade. Ubuntu’s package manager relies on local cache files that index available software from enabled repositories. If these files are missing or stale, apt cannot find the packages you request.
sudo apt update
This command contacts all enabled repositories and downloads the latest list of available packages. If the system was upgraded or not updated recently, this step restores the ability to locate and install packages.
sudo apt upgrade -y
This ensures you have the newest versions of installed software and their dependencies, minimizing conflicts or missing packages after an upgrade.
Join readers who trust AllThings.How
Add us as a preferred source on Google so our practical guides show up first next time you search.
Add to Google Preferences →Verify and Correct Repository Configuration
After a major upgrade, repository files in /etc/apt/sources.list and /etc/apt/sources.list.d/ may reference the wrong Ubuntu release or be misnamed. This prevents apt from finding packages for your current version.
lsb_release -a
The output will display your current release and codename (for Ubuntu 24.04, the codename is noble).
/etc/apt/sources.list in a text editor with root privileges and confirm that repository lines use the correct codename for your Ubuntu version. For example:deb http://archive.ubuntu.com/ubuntu/ noble main restricted universe multiverse
If you see references to an older version (such as jammy), update them to noble for Ubuntu 24.04.
/etc/apt/sources.list.d/ for any repository files that were renamed or disabled during the upgrade (such as .distUpgrade suffixes). Restore their original names if needed, then run sudo apt update again.Correct repository configuration ensures apt can access all packages intended for your Ubuntu release.
Enable Universe, Multiverse, and Restricted Repositories
Some packages are not in the default “main” repository. If you attempt to install a package from “universe,” “multiverse,” or “restricted,” and those repositories are not enabled, apt will fail to find the package.
sudo add-apt-repository universe
sudo add-apt-repository multiverse
sudo add-apt-repository restricted
sudo apt update
With these repositories enabled, apt can access a much wider range of software, including many community-maintained and third-party packages.
Check Package Name Spelling and Case Sensitivity
APT package names are case-sensitive and must be typed exactly. Typos or incorrect capitalization will prevent the package manager from locating the package.
libjpeg-dev is correct, but LibJpeg-dev will not be found.apt search <partial-name>
This helps identify the correct spelling and package name as used in the repository.
Confirm Package Availability for Ubuntu 24.04
Some packages may not be available for your specific Ubuntu release. To verify availability:
noble) in the search fields.If the package is not listed for your version, it cannot be installed directly via apt. You may need to look for alternative installation methods, such as Snap, Flatpak, or downloading a .deb file from the project’s website.
Switch to a Different Mirror if Downloads Fail
Occasionally, a regional mirror may fall out of sync or become unavailable, causing apt to miss packages. Switching to a different mirror can resolve these issues.
/etc/apt/sources.list and replace the current mirror URL with another from the official Ubuntu mirrors list.For example, replace:
deb http://archive.ubuntu.com/ubuntu/ noble main restricted
with:
deb http://mirror.example.com/ubuntu/ noble main restricted
sudo apt update
This action refreshes the cache from the new mirror, potentially resolving missing package errors due to out-of-date or unavailable servers.
Clear the Package Cache if Corruption Is Suspected
In rare cases, a corrupted package cache can block apt from locating packages.
sudo apt clean
sudo apt update
This removes old cached files and forces apt to redownload fresh package information.
Verify System Support Status
APT will not install new packages on unsupported or end-of-life Ubuntu releases. Confirm your system is still supported:
hwe-support-status --verbose
The output will display whether your Ubuntu version is still receiving updates. If not, you must upgrade to a supported release before package installation will work reliably.
Following these steps restores normal apt package installation on Ubuntu 24.04, resolving “Unable to locate package” errors and ensuring your system can access the full range of available software.






