Unable to locate package error on Ubuntu 20.04 Focal Fossa Linux

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

Unable to locate package error on Ubuntu 20.04 Focal Fossa Linux

Unable to locate package error on Ubuntu 20.04 Focal Fossa Linux

Software Requirements and Conventions Used

Software Requirements and Linux Command Line Conventions
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
  1. 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
    


  2. 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 and python-pip are two distinct packages.

  3. 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.
    Search for exact package name

    Search for exact package name while also selecting your Ubuntu system version.

    If the search returns exact hit in means that the package exists

    If the search returns exact hit in means that the package exists and that your system most likely does not have the appropriate repository enabled in order to install it.

    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 the universe 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.