WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Not able to finish sudo apt-get -y upgrade command

Open nimitbhargava opened this issue 9 years ago • 9 comments

  • Windows build number: Microsoft Windows [Version 10.0.15063]

  • What I am doing: running sudo apt-get -y upgrade command

  • What's happening: Getting

Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 coreutils amd64 8.25-2ubuntu3~16.04 [1,174 kB]
Err:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 coreutils amd64 8.25-2ubuntu3~16.04
  Hash Sum mismatch
Fetched 1,174 kB in 27s (42.8 kB/s)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/c/coreutils/coreutils_8.25-2ubuntu3~16.04_amd64.deb  Hash Sum mismatch

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

when sudo apt-get -y upgrade command is run image

  • What's wrong / what should be happening instead: It should simply upgrade

nimitbhargava avatar Jul 30 '17 19:07 nimitbhargava

Try:

sudo rm -rf /var/lib/apt/lists/*
sudo apt-get clean && sudo apt-get update && sudo apt-get -y upgrade

This rain dance is sometimes necessary on the Real Thing too. YRMV.

therealkenc avatar Jul 30 '17 22:07 therealkenc

@therealkenc no luck with the above command.

nimitbhargava avatar Jul 31 '17 06:07 nimitbhargava

Hmm. Best evidence is it isn't a WSL thing, especially considering this is coreutils. You are getting an hash mismatch because, well, the hashes don't match; not because some WSL syscall failed to perform its duties correctly. [Though with an odd enough confluence of events anything is possible.] I am taking as a given you already tried --fix-missing per the error.

Given the amount of time you've probably already spent on it, your simplest path forward is probably lxrun /unininstall lxrun /install. Which is advice I am loathe to give, because it's a solution offered far too often around here. Alternately you could try StackOverflow or the Ubuntu community and fight it; or you'll get lucky and someone else will jump in. Bonne chance.

therealkenc avatar Jul 31 '17 13:07 therealkenc

@therealkenc wrote:

Alternately you could try StackOverflow

Actually, Stack Overflow's sister site Super User would probably be even better.

When you ask questions there, it's best to always both:

  1. Tag them with windows-linux-subsystem.
  2. Also mention in the main body text that you're using the Windows Linux Subsystem.

@nimitbhargava: Please keep us updated! If you ask for help on another website, please provide us with a link to that website.

unforgettableid avatar Jul 31 '17 21:07 unforgettableid

I too am getting this error

Get:1 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:3 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu xenial InRelease [17.5 kB]
Get:4 https://download.docker.com/linux/ubuntu xenial InRelease [38.9 kB]
Get:5 https://deb.nodesource.com/node_8.x xenial InRelease [4,634 B]
Get:6 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu xenial/main amd64 Packages [20.6 kB]
Get:7 https://deb.nodesource.com/node_8.x xenial/main Sources [763 B]
Get:8 https://deb.nodesource.com/node_8.x xenial/main amd64 Packages [974 B]
Get:9 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [325 kB]
Get:10 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages [1,966 B]
Get:11 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu xenial/main Translation-en [5,652 B]
Get:12 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:13 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [138 kB]
Get:14 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1,201 kB]
Get:15 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [7,420 B]
Get:16 http://security.ubuntu.com/ubuntu xenial-security/restricted Translation-en [2,428 B]
Get:17 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [152 kB]
Get:18 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [77.9 kB]
Get:19 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [2,748 B]
Get:20 http://security.ubuntu.com/ubuntu xenial-security/multiverse Translation-en [1,232 B]
Get:21 http://archive.ubuntu.com/ubuntu xenial/main Translation-en [568 kB]
Get:22 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [8,344 B]
Get:23 http://archive.ubuntu.com/ubuntu xenial/restricted Translation-en [2,908 B]
Get:24 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [7,532 kB]
Get:25 http://archive.ubuntu.com/ubuntu xenial/universe Translation-en [4,354 kB]
Get:26 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [144 kB]
Get:27 http://archive.ubuntu.com/ubuntu xenial/multiverse Translation-en [106 kB]
Get:28 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [599 kB]
Err:28 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
  Hash Sum mismatch
Get:29 http://archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [242 kB]
Get:30 http://archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages [7,804 B]
Get:31 http://archive.ubuntu.com/ubuntu xenial-updates/restricted Translation-en [2,548 B]
Get:32 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [512 kB]
Get:33 http://archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [199 kB]
Get:34 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [15.5 kB]
Get:35 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse Translation-en [7,540 B]
Fetched 16.8 MB in 1min 53s (147 kB/s)
Reading package lists... Done
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-amd64/by-hash/SHA256/fa1dcefdd0fd5becd802bce244fb0e2265ea9e9438289565df5d6d8ef8061f5d  Hash Sum mismatch
E: Some index files failed to download. They have been ignored, or old ones used instead.

I've had this error before, and I normally just run the usual (clean, update, upgrade) and that fixes it. I have no idea why but it doesn't seem to be fixing the problem this time :P . Reinstalling the subsystem is probably the last thing I want to do, I'll just wait it out and see if Ubuntu patches/fixes it on their end.

EDIT: After turning my pc off for the night and running therealkenc's list of commands in the morning, everything was working again :)

DeadPixelz01 avatar Aug 05 '17 15:08 DeadPixelz01

EDIT: After turning my pc off for the night and running therealkenc's list of commands in the morning, everything was working again :)

Closing this out as generic apt goblins since there is no real WSL actionable here.

therealkenc avatar Nov 22 '17 13:11 therealkenc

Try:

sudo rm -rf /var/lib/apt/lists/*
sudo apt-get clean && sudo apt-get update && sudo apt-get -y upgrade

This rain dance is sometimes necessary on the Real Thing too. YRMV.

Worked great for me. Thanks!

Jimmy-Py avatar Feb 16 '20 03:02 Jimmy-Py

Same problem and the suggested fix doesn't work for me.

Steps to reproduce:

  • Install Windows 10
  • Install WSL with Ubuntu
  • Try to update
  • Get has match Wiping repository list doesn't help

Is there any other fix for this yet?

Thanks Robin

robinwilson16 avatar Jun 21 '20 11:06 robinwilson16

Ok this has worked:

sudo rm -rf /var/lib/apt/lists/partial
sudo apt-get update -o Acquire::CompressionTypes::Order::=gz
sudo apt-get upgrade -o Acquire::CompressionTypes::Order::=gz

robinwilson16 avatar Jun 21 '20 11:06 robinwilson16