0

So, I'm new to linux I'm using Lubuntu 17.10. When I try to install a package either in a terminal or software centre. I tried everything even re-installing and that didn't help!

When I try to install through terminal I get this message:
E: Unable to locate package (package name).

In the software centre I try to install a program but nothing happens :/

Can anyone help me? Thanks!

  • Please first make sure that the package name is correct : `apt-cache search [name]` or *part of name*. Or use the on-line search for package name : https://packages.ubuntu.com/search?keywords=g%2B%2B&searchon=names – Knud Larsen May 16 '18 at 23:14
  • 1
    Did you first run: `sudo apt update`? Welcome to Ask Ubuntu. – chili555 May 16 '18 at 23:34
  • Possible duplicate of ["Unable to locate package" while trying to install packages with APT](https://askubuntu.com/questions/378558/unable-to-locate-package-while-trying-to-install-packages-with-apt) – karel May 17 '18 at 08:48

1 Answers1

0

This error shows up when your Sources.list doesn't have the information about the package you're trying to install.

If you're too new and don't know what is sources.list.

Apt uses a file that lists the 'sources' from which packages can be obtained. This file is located at /etc/apt/sources.list.

Possible steps to fix your issue :

  1. Make sure that the package you want to install actually exists or not.
  2. Run sudo apt-update to update sources.list, then try installing package again.
  3. If even after step 2 your problem isn't solving, generate a sources.list using this online website : https://repogen.simplylinux.ch/

You can also try add repositories (main, universe, restricted, multiverse) manually by using the following commands

sudo add-apt-repository main

sudo add-apt-repository universe

sudo add-apt-repository restricted

sudo add-apt-repository multiverse
Vishesh Gautam
  • 718
  • 3
  • 14
  • I'd maybe change the formatting of last block of code, it's not very clear as it is (at least on mobile). – dsSTORM May 17 '18 at 08:48