6

I have installed Bash on Ubuntu on Windows (after enabling the feature in settings)

I don't remember what I did, but the result was that apt-get doesn't locate ANY package

With and without sudo:

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

I tried many fixes found on this site, like:

apt-get upgrade & apt-get update

& I tried recreating resources.list using nano

How could this be fixed?

marked as duplicate by Kulfy, Zanna, pomsky, karel, Eric Carvalho Dec 30 '18 at 14:36

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • You did something you can't remember? Can you check your history? – Zzzach... Apr 20 '16 at 21:25
  • What is the output of grep -v '#' /etc/apt/sources.list? – Florian Diesch Apr 20 '16 at 21:26
  • @Zzzach... found in history: em /etc/apt-/sources.list rm /etc/apt/sources.list rm /etc/apt/sources.list.save /etc/apt/sources.list – NHKomaiha Apr 20 '16 at 21:26
  • @FlorianDiesch out: deb http://archive.ubuntu.com/ubuntu trusty main universe restricted multiverse – NHKomaiha Apr 20 '16 at 21:27
  • 1
    @Zzzach... apt-get update gives 1 line output only, and it's strange. NOTE: see my old comment i edited it – NHKomaiha Apr 20 '16 at 21:30
6

You don't have a correctly setup /etc/apt/sources.list file. Try pasting the following into /etc/apt/sources.list:

deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty universe
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu vivid partner
# deb-src http://archive.canonical.com/ubuntu vivid partner

Then try running apt-get update again.

  • done, update output error: dpaste.com/351W8AN – NHKomaiha Apr 20 '16 at 21:48
  • Are you connected to the internet? Do ping www.google.com -c 3. – Zzzach... Apr 20 '16 at 21:48
  • ping: icmp open socket: Socket type not supported NOTE: i remember that apt-get out was like that before the problem, so apt-get problem solved probably – NHKomaiha Apr 20 '16 at 21:50
  • Then I don't think your /etc/resolve.conf is setup correctly. Take a look at this maybe. (and btw, I'll try to keep helping you in an hour). – Zzzach... Apr 20 '16 at 21:52
  • I read the thread from the begining and found that i tested all, and now i tested a command in CMD: lxrun /update which i think is equal to apt-get upgrade in Bash, Out: dpaste.com/0V8JTGG – NHKomaiha Apr 20 '16 at 22:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.