10

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?

Zanna
  • 69,223
  • 56
  • 216
  • 327
Galacticai
  • 111
  • 1
  • 1
  • 7

1 Answers1

10

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.

AlwaysTalkingAboutMyDog
  • 3,703
  • 2
  • 25
  • 38
  • done, update output error: http://dpaste.com/351W8AN – Galacticai Apr 20 '16 at 21:48
  • Are you connected to the internet? Do `ping www.google.com -c 3`. – AlwaysTalkingAboutMyDog 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 – Galacticai Apr 20 '16 at 21:50
  • Then I don't think your `/etc/resolve.conf` is setup correctly. Take a look at [this maybe](https://github.com/Microsoft/BashOnWindows/issues/5). (and btw, I'll try to keep helping you in an hour). – AlwaysTalkingAboutMyDog 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: http://dpaste.com/0V8JTGG – Galacticai Apr 20 '16 at 22:06
  • There is still something wrong with your network. Seems like it might be something more than just Ubuntu's fault, though. The one bug report on BashOnLinux's github is still open. As someone else commented, this setup is really new, and really unstable. I would look for help from a developer or make a bug request on the git hub link before (or try to find a forum for BashOnWindows). – AlwaysTalkingAboutMyDog Apr 20 '16 at 22:54
  • so it's ok... at least i have a normal Ubuntu on Windows, i mean i have it like others, without extra bugs made by me – Galacticai Apr 21 '16 at 16:58
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/38705/discussion-between-nhk-and-zzzach). – Galacticai Apr 21 '16 at 20:24