E: Failed to fetch http://np.archive.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-i386/by-hash/SHA256/06037c30d4089fb5eb7743e3e8b8f0844c499231dcfc81e7e2ed8beb2e170606 Hash Sum mismatch
E: Some index files failed to download. They have been ignored, or old ones used instead.

- 36,677
-
1Related, maybe a duplicate: Trouble downloading packages list due to a “Hash sum mismatch” error – wjandrea Dec 20 '17 at 03:02
2 Answers
That's a pretty long chained command. Break it into smaller chunks and execute them separately, like this:
$ sudo apt update
$ sudo apt upgrade
$ sudo apt dist-upgrade
$ sudo apt autoremove
Work through each step, fixing any issues as they arise.
Regarding the error you're getting, I suspect it's coming from the first command. Since you've chained the commands with &&, then the error is preventing the rest of the commands from executing, as it should. The first thing I'd do is check the contents of the /etc/apt/sources.list file. I suspect you have an overly complex url for the update site. If you see this in the file:
http://np.archive.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-i386/by-hash/SHA256/06037c30d4089fb5eb7743e3e8b8f0844c499231dcfc81e7e2ed8beb2e170606
then make a backup of the file, then edit that line to remove the hashy thing that apt is complaining about. Like this:
http://np.archive.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-i386/
Then re-try the update...
$ sudo apt update
Mine says deb http://us.archive.ubuntu.com/ubuntu/ artful main restricted
. I'm not sure what the "np" is for in yours, but mine is "us".
The functional content of my Ubuntu 17.10 sources.list file (minus comments) is:
deb http://us.archive.ubuntu.com/ubuntu/ artful main restricted
deb http://us.archive.ubuntu.com/ubuntu/ artful-updates main restricted
deb http://us.archive.ubuntu.com/ubuntu/ artful universe
deb http://us.archive.ubuntu.com/ubuntu/ artful-updates universe
deb http://us.archive.ubuntu.com/ubuntu/ artful multiverse
deb http://us.archive.ubuntu.com/ubuntu/ artful-updates multiverse
deb http://us.archive.ubuntu.com/ubuntu/ artful-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu artful-security main restricted
deb http://security.ubuntu.com/ubuntu artful-security universe
deb http://security.ubuntu.com/ubuntu artful-security multiverse

- 14,236
- 4
- 48
- 98

- 254
- 1
- 8
-
-
A line in the sources list that's just a URL would be invalid, so I don't think this is what's causing the issue. – wjandrea Dec 20 '17 at 03:04
-
wjandrea, you are correct, I was just focusing on the part that needed editing. – Phillip H. Blanton Dec 20 '17 at 21:14
- Clean apt cache with
sudo apt-get clean
- Update package lists with
sudo apt-get update
- Resume installation with
sudo apt-get install -f

- 99,918