Bash (on Windows 10) doesn't locate any package

29,514

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.

Share:
29,514

Related videos on Youtube

XEROling
Author by

XEROling

You.. You missed a semicolon. Stay safe.

Updated on September 18, 2022

Comments

  • XEROling
    XEROling almost 2 years

    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?

    • AlwaysTalkingAboutMyDog
      AlwaysTalkingAboutMyDog about 8 years
      You did something you can't remember? Can you check your history?
    • Christopher B. Adkins
      Christopher B. Adkins about 8 years
      What is the output of grep -v '#' /etc/apt/sources.list?
    • XEROling
      XEROling about 8 years
      @Zzzach... found in history: em /etc/apt-/sources.list rm /etc/apt/sources.list rm /etc/apt/sources.list.save /etc/apt/sources.list
    • XEROling
      XEROling about 8 years
      @FlorianDiesch out: deb http://archive.ubuntu.com/ubuntu trusty main universe restricted multiverse
    • AlwaysTalkingAboutMyDog
      AlwaysTalkingAboutMyDog about 8 years
      Alright, I was wondering if the history command outputting anything, maybe the command you did earlier that caused the problem. Does apt-get update work properly, outputting various downloading lines?
    • Thomas Ward
      Thomas Ward about 8 years
      I don't think this is even supposed to work - Bash on Windows 10 is NOWHERE near stable enough, and has a lot of issues reaching out to the Web. it's also sandboxed, so I would NOT believe that apt-get would work just yet.
    • XEROling
      XEROling about 8 years
      @Zzzach... apt-get update gives 1 line output only, and it's strange. NOTE: see my old comment i edited it
    • XEROling
      XEROling about 8 years
      @ThomasW. It wasn't connecting to internet at the begining but it does now, after editing /etc/resolv.conf
    • AlwaysTalkingAboutMyDog
      AlwaysTalkingAboutMyDog about 8 years
      Uh, well, the rm /etc/apt/sources.list... is the problem. You don't have any source destinations setup...
    • XEROling
      XEROling about 8 years
      @Zzzach... how to recreate it correctly?, note that i created it again after removing with that command, (generated using repogen.simplylinux.ch)
    • AlwaysTalkingAboutMyDog
      AlwaysTalkingAboutMyDog about 8 years
      Hmm, try the answer I just posted. If it still doesn't work after that, let me know.
    • Tore Aurstad
      Tore Aurstad over 4 years
      apt-get update --fix-missing helped me out - WSL not getting any packages
  • XEROling
    XEROling about 8 years
    done, update output error: dpaste.com/351W8AN
  • XEROling
    XEROling about 8 years
    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
  • AlwaysTalkingAboutMyDog
    AlwaysTalkingAboutMyDog about 8 years
    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).
  • XEROling
    XEROling about 8 years
    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
  • AlwaysTalkingAboutMyDog
    AlwaysTalkingAboutMyDog about 8 years
    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).
  • XEROling
    XEROling about 8 years
    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
  • XEROling
    XEROling about 8 years