'Hash Sum mismatch'. How to edit /etc/apt/sources.list specifically?

1k views Asked by At

When I try to update my apt-get:

$ sudo apt-get update

The Warning will appear every time like beblow:

W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/trusty-updates/main/binary-amd64/Packages Hash Sum mismatch

After searching the solution for this problem, I met one as below:

For now, I edited /etc/apt/sources.list and updated it with a new mirror which solved the primary issue of not being able to find a candidate package.

However, I don't know how to edit /etc/apt/sources.list specifically. Could you tell me how to edit in detail? Thanks in advance.

1

There are 1 answers

0
Matthew Schuchard On BEST ANSWER

Start by opening it with a text editor using elevated user privileges. In this example, I use vim:

sudo vim /etc/apt/sources.list

Inside you should see a line like:

deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted

The advice is telling you to change the cn country code to a different country code mirror. For example, I have the us mirror there instead.