Ubuntu – “Unable to locate package” while trying to install packages with APT


When I try to install any package through the command line, I get an error.

$ sudo apt-get install <package>
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package <package>

Can anyone help me on this?

Best Answer

First, check if the package actually exists:

  1. Go to packages.ubuntu.com with a web browser.
  2. Scroll down to "Search package directories"
  3. Enter the package which you're trying to install into the "Keyword" field.

    Enable "Only show exact matches:"

    Change the "Distribution" to which version of Ubuntu you're using.

    enter image description here

If there are no results, the package you are looking for doesn't exist and the next steps will not work. It may require a third party PPA or an alternative installation method.

If results are found, the package exists and you may continue with these steps:

  1. Open Software Sources (or Software & Updates in 13.04+) by searching for it in the Dash.
  2. Open the "Ubuntu Software" tab.
  3. Ensure that the first 4 check boxes on this tab are enabled:

    enter image description here

  4. Update the package lists, then test with these commands:

    sudo apt-get update
    sudo apt-get install <TEST_PACKAGE>
Related Question