Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

OK, so this is my first SO question so I'm gonna try my best to lay this out.

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

like image 325
G_Fyre Avatar asked Jan 10 '18 03:01

G_Fyre


People also ask

Why WSL -- Install is not working?

Ensure that the Windows Subsystem for Linux Optional Component is installed. Additionally, if you are using an ARM64 device and running this command from PowerShell, you will receive this error. Instead run wsl.exe from PowerShell Core, or Command Prompt.

How do I fix 404 not found Ubuntu?

Here is a quick way to fix " 404 Not Found " errors on old Ubuntu by switching to old-releases repositories. First, replace main / security repositories with old-releases versions as follows. Then open /etc/apt/sources. list with a text editor, and look for extras.ubuntu.com .

How do I fix Windows Subsystem for Linux has no installed distributions?

Open the https://aka.ms/wslstore link as mentioned in the above notification. The link resolves to ms-windows-store://collection/?CollectionId=LinuxDistros and launches the Store app. You'll see the available Linux distros in the Microsoft Store app. Pick the one you want and install it.


2 Answers

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.

like image 94
Sir4ur0n Avatar answered Oct 14 '22 20:10

Sir4ur0n


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

like image 41
Craig Silver Avatar answered Oct 14 '22 20:10

Craig Silver