0

I checked the duplicate questions with

Hash Sum mismatch

And ran these commands

sudo rm -rf /var/lib/apt/lists/*

sudo apt-get update

Things ran okay till I tried to install apache2 using the command

sudo apt-get install apache2

Which is when I get a Hash Sum Mismatch and also Bad header line Bad header data

Err:3 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 liblua5.2-0 amd64 5.2.4-1.1build1
Bad header line Bad header data [IP: 192.168.1.151 808]
Fetched 19.4 kB in 3s (7,756 B/s)
E: Failed to fetch http://in.archive.ubuntu.com/ubuntu/pool/main/a/apr-util/libaprutil1-ldap_1.6.1-2_amd64.deb  Hash Sum mismatch
Hashes of expected file:
- SHA256:77045fb05b8db8960e6dcdc6339141781a13719bbc2d94452b762fdbbcc9c9fe
- SHA1:6e6549483a1a60dd027c141e5a0d6fe2facad3a5 [weak]
- MD5Sum:ab9dde6f6554add8d4100974bb907363 [weak]
- Filesize:8764 [weak]
Hashes of received file:
- SHA256:c0ee4206cdf0ce092b33ad56b5d230979cc1ec3666df6ab2b5282bb058ebd304
- SHA1:86cd9504ec5ac110e3476381c01156ba11f03b73 [weak]
- MD5Sum:a4faf00c1562fdfd8af187053422aa25 [weak]
- Filesize:8764 [weak]
Last modification reported: Tue, 27 Feb 2018 09:19:27 +0000

I also checked the question to use internet through a proxy address.

The IP 192.168.1.151:808 in the error code is a proxy address for accessing the internet. I am using it by mentioning the following lines in the /etc/apt/apt.conf file

Acquire::http::Proxy "http://192.168.1.151:808";
Acquire::https::Proxy "http://192.168.1.151:808";
Acquire::ftp::Proxy "http://192.168.1.151:808";

How can I install apache2 without any errors?

Harish
  • 101
  • 3

1 Answers1

0

Using sudo apt-get install software instead of sudo apt install software fixes the problem.

Harish
  • 101
  • 3
  • I just got the same thing with emacs25, but sudo apt-get install emacs25 resulted in the same Hash Sum mismatch. (I also tried deleting the files in the lists directory first.) I just upgraded from 16.04 xenial to 18.04 bionic, so the upgrade removed emacs24. – Trey Nov 30 '18 at 22:19
  • I found a possible solution though, here: https://askubuntu.com/a/1097538/333672 – Trey Nov 30 '18 at 22:45