2
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.
George Udosen
  • 36,677

2 Answers2

1

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
wjandrea
  • 14,236
  • 4
  • 48
  • 98
0
  1. Clean apt cache with sudo apt-get clean
  2. Update package lists with sudo apt-get update
  3. Resume installation with sudo apt-get install -f
N0rbert
  • 99,918