The objective of this tutorial is to provide the reader with a troubleshooting guidance on how to resolve the error message Unable to locate package on Ubuntu 20.04 Focal Fossa Linux.
In this tutorial you will learn:
- How to update package repository index
- How to check Ubuntu version
- How to use Ubuntu package search
- How to add repository
Software Requirements and Conventions Used
Category | Requirements, Conventions or Software Version Used |
---|---|
System | Installed Ubuntu 20.04 or upgraded Ubuntu 20.04 Focal Fossa |
Software | N/A |
Other | Privileged access to your Linux system as root or via the sudo command. |
Conventions |
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command$ – requires given linux commands to be executed as a regular non-privileged user |
How to fix the unable to locate package error on Ubuntu 20.04 step by step instructions
Let’s say you have executed a command which will install python-pip
package and it resulted in the following error message:
# apt install python-pip Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package python-pip
- The first step you may try to resolve the
E: Unable to locate package python-pip
error message is to update the system’s package index. To do so execute:$ sudo apt update
- If the above step did not help it is worth to check whether the package name of the package you wish to install does not contain any typos.
Furthermore, Ubuntu as any other GNU/Linux distribution systems are case sensitive which means that
Python-pip
andpython-pip
are two distinct packages. - Are you sure that this package exists? Check your Ubuntu version and search the official Ubuntu package repository for the specific package name of the package you wish to install.
Take a note of the repository name in which the package is located. In this case the package
python-pip
is available as part of theuniverse
repository.Next, add the appropriate repository and run the update package index command:
$ sudo apt update
The package should now be available for the installation.