You’ve tried to install something, but Ubuntu can’t bring it on-board. Apt mentions something about “no installation candidate.” What does this mean, what’s the source of the problem, and is it fixable? Here are some ways you can fix it.
What Does It Mean?
If you try to install a package for which Apt has no clue, it will inform you it’s unable to locate it. That can happen if you mistype the name of a package or try to install an application that is not in the repository.
There’s also another case of missing packages – Apt can’t find it in its usual location but knows it exists since another package references it.
In such cases, the problem is because Apt doesn’t know where and how to find it.
How Can You Fix It?
Start by checking if the entry was removed during the last update/upgrade you performed. You don’t have to hunt it down in cryptic logs. You just need to run another update/upgrade to get the latest versions of your installed software. In the process, Apt’s database will be updated. Then, try installing the package again.
If that didn’t work, you’ll probably find the particular package in a currently unlisted repository. You only have to find and add it to your distribution’s software sources.
The Internet is your friend in finding the missing repository. Once located, you can add the repository to Ubuntu with the command:
In some rare cases, the problem isn’t a missing repository but a renamed package. To check for packages with similar names that are available, use the command:
Depending on what you’re looking for, this may bring up a huge list of available software. Here’s a trick to narrow it down: Usually, package names won’t have radical name changes. What may change is a version number or a secondary keyword. Thankfully,
apt-cache supports Regex. Thus, you can search for packages that begin with the specific keyword.
For example, suppose you entered the above command using “firefox” as the PACKAGE_NAME. In that case, you’d see dozens of entries with the word firefox in their name or description. You could try the following instead:
The above command will return a list of all packages whose name begins with PACKAGE_NAME. If you replaced PACKAGE_NAME for firefox, you’d see a list of all packages that start with the word “firefox.” Among them, you’d probably find an alternative to the one you’re seeking.
Have you ever met the “no installation candidate” problem, and if yes, how did you solve it? Tell us in the comments section below. Read on to learn how to set up a git username and email in Ubuntu.