G_Fyre
G_Fyre

Reputation: 183

apt in Linux Subsystem for Windows 10 is failing with 404 Not Found

I have a Windows 10 laptop on which I am trying to install gcc. I have in the past tried alternatives such as Netbeans, Cygwin and various emulators and virtual machines all to no avail.

What has been working so far is that I enabled the 'new' windows developer mode which allowed me to download a Linux bash shell from the windows store. It works for all the regular Linux commands, but doesn't have gcc installed.

When I type in gcc (or gcc --version) in the shell, it prints the following line:

The program 'gcc' is currently not installed. You can install it by typing: sudo apt install gcc

Which I tried, it then ran through a bunch of installer stuff but consistently seemed to run into errors such as the following:

Err:7 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libdpkg- >perl all 1.18.4ubuntu1.2

404 Not Found [IP: INSERT IP ADDRESS HERE ]

where the ip address is different on each error line.

It ultimately fails with the following line:

Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

I have tried but again I get the same kinds of errors as above.

I would really like to get gcc working in the Windows/Linux shell as it is working great for everything else, and I'm trying to keep the number of programs on my computer to a minimum.

Does anyone know why this isn't working, or how (if possible) I can make it work?

P.S I do need it to be gcc because of school reasons

Upvotes: 17

Views: 13034

Answers (5)

Mohsen Aghakarami
Mohsen Aghakarami

Reputation: 1

wsl.exe --update

use this command

Upvotes: -2

Ihor
Ihor

Reputation: 342

Try to run Ubuntu application in Windows with an option "Run as Administrator".

Upvotes: -1

Sir4ur0n
Sir4ur0n

Reputation: 1823

For what it's worth: I landed on this SO topic after having a similar issue.

What fixed it for me was to run

sudo apt-get update
sudo apt-get upgrade

I guess the repo URLs were too old, even though my Ubuntu was in a recent version.

Upvotes: 36

Craig
Craig

Reputation: 661

I just ran into the same thing attempting to install python-pip. According to this article, this happens when you have the Windows 10 Anniversary Update (older) instead of the Creators update (newer). The solution is to either uninstall and re-install Ubuntu, or upgrade it (from 14.04 to 16.04). I found the upgrade to be simple and painless:

sudo do-release-upgrade

To check what you have, before and after via:

lsb_release -a

Upvotes: 5

wbg
wbg

Reputation: 918

I had the same problem. Pinging the IP resulted in no response and visiting the website returned a 404.

I found a ppa with most current GCC and registered the PPA and was able to successfully install GCC with it; ppa website. I used GCC to build some software I wanted that was not found with apt-get.

From their page:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update

Upvotes: 0

Related Questions