Solution to HASH checksum mismatch in UBUNTU

Source: Internet
Author: User
Tags hash ssh port number ssh server

There is a problem in Ubuntu that will often plague you, that is, running apt-get update prompts that the Hash checksum does not match.
W: cannot download bzip2:/var/lib/apt/lists/partial/mirrors.163.com _ ubuntu_dists_saucy-security_universe_binary-i386_Packages Hash checksum does not match
W: cannot download bzip2:/var/lib/apt/lists/partial/mirrors.163.com _ ubuntu_dists_saucy-security_multiverse_binary-i386_Packages Hash checksum does not match
W: unable to download bzip2:/var/lib/apt/lists/partial/repo.mate-desktop.org _ ubuntu_dists_saucy_main_binary-amd64_Packages Hash checksum does not match
W: unable to download bzip2:/var/lib/apt/lists/partial/repo.mate-desktop.org _ ubuntu_dists_saucy_main_binary-i386_Packages Hash checksum does not match
E: Some index files failed to download. They have been ignored, or old ones used instead.
There are various solutions for searching on the Internet, but the final judgment is still the cause of the network. Since it is determined that it is caused by the network, there is a corresponding solution.
Method 1 configure http sever for APT.
Because I have enabled the SSH SERVER in VPS, it is very convenient to enable the SSH TUNNEL, but it is a pity that apt-get only supports http proxy, therefore, you also need to install privoxy to convert the scoks5 proxy of ssh tunnel to the http proxy.
For more information about enabling and managing ssh tunnel, see the previous article: gSTM-graph ssh Tunnel manager.
Here we will talk about the installation and configuration of privoxy:

A. Install
Sudo apt-fast install privoxy

B. Configuration

Edit/etc/privoxy/config to enable socks to convert http to privoxy. Find the bold line below in config, remove the comment #, and change the port number to the one set in the previous ststamp.
Listen-address localhost: 8118
# Forward-socks5/127.0.0.1: 7070
Save and start privoxy.
Sudo/etc/init. d/privoxy start
Finally, update apt through http proxy
Sudo apt-get-o Acquire: http: proxy = "http: // 127.0.0.1: 8118/" update

Method 2: replace apt-get with apt-fast. This is an unexpected discovery. If apt-fast is used, there will be no Hash check inconsistency.

Apt-fast is a script that uses axel to accelerate the installation of apt-get Software. Because it is a multi-threaded download, the acceleration effect is quite obvious.

Add a PPA source and install apt-fast
Sudo add-apt-repository ppa: tldm217/tahutek.net
Sudo apt-get update & sudo apt-get install apt-fast

Usage:

Replace the original apt-get command with the apt-fast command, for example:
Apt-fast update
Apt-fast install fcitx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.