Bị lỗi data client clientdeltabuild0.package hash sum mismatch required md5

I updated to Big Sur, Then I had to update to VMware Fusion 12. I have been having issues ever since. I saw this issue is happening to windows users but I can't find a fix for OSX.

//unix.stackexchange.com/questions/574760/kali-linux-apt-update-returns-hash-sum-mismatch-erro...

I'm experiencing exactly the same issue as described in this question: Kali Linux: apt-get update returns “Hash Sum mismatch” error. Before you mark this as a duplicate however, I have tried the solutions posted there, as well as on numerous other sites, including:

sudo apt-get clean sudo rm -rf /var/lib/apt/lists/* sudo apt-get update

Editing /etc/apt/sources.list with alternate official mirrors, such as deb //mirrors.ocf.berkeley.edu/kali kali-rolling main non-free contrib or deb //http.kali.org/kali kali-rolling main non-free contrib

Everything worked after I first imported the VM. I ran sudo apt update and it found some ~650 packages to upgrade. I ran sudo apt upgrade and it encountered an error partway through. That error was solved using sudo apt --fix-broken install, but that is when this hash sum error began. Unfortunately due to hours of troubleshooting I no longer have the details of the earlier error, but I believe it was an error extracting a package due to corrupt data.

I've tried multiple official mirrors, but I get the same error. Additionally, when I downloaded the Packages.gz file here on my Windows machine [VM host] and computed the SHA256 hash, I got the exact hash that apt printed as the expected value. This led me to believe that the error was not with the mirror but with my VM.

The next thing I tried was wget //mirrors.ocf.berkeley.edu/kali/dists/kali-rolling/main/binary-amd64/Packages.gz followed by sha256sum Packages.gz, which provided yet another different hash output.

To be clear, I have seen 3 different hashes for the same file:

  1. The "correct" hash shown by apt as expected, which is the one that windows also produced after downloading the file using a browser
  2. The incorrect hash calculated by apt, which led to the error
  3. A different hash calculated by sha256sum after downloading the file using wget using the same URL as for the browser download

I should also note that I have only been referencing the SHA256 hash in each step. The other hash functions are also mismatched when I run sudo apt update, but the file size is the same. I had considered that downloads might be failing due to limited disk space [it is a VM after all] but I don't think that's the case.

What am I missing?

Previously I was using Docker on Windows and got such errors maybe 1 or 2 times in 2 years and now on Mac I'm getting them all the time and cannot build my images.

What can be reason of this? Should I do something on my Mac or maybe change something in my Dockerfile to make it work?

Just to note, I was also playing with changes like this:

# Base image
FROM ubuntu:16.04
RUN export DEBIAN_FRONTEND=noninteractive
RUN echo 'Acquire::Acquire-by-hash "yes";' >> /etc/apt/apt.conf
RUN echo 'Acquire::CompressionTypes::Order "gz";' >> /etc/apt/apt.conf
# Update packages list and system
RUN apt-get -y update
RUN apt-get -y clean
RUN apt-get -y upgrade
RUN apt-get -y clean
RUN apt-get dist-upgrade
# Allow to use add-apt-repository command
RUN apt-get -y install software-properties-common locales poppler-utils

or

# Base image
FROM ubuntu:16.04
RUN export DEBIAN_FRONTEND=noninteractive
RUN rm -rf /var/lib/apt/lists/partial
RUN echo 'Acquire::By-Hash "yes";' >> /etc/apt/apt.conf
RUN echo 'Acquire::CompressionTypes::Order:: "gz";' >> /etc/apt/apt.conf
# Update packages list and system
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
RUN apt-get -y clean
RUN apt-get -y upgrade
RUN apt-get -y clean
RUN apt-get dist-upgrade
# Allow to use add-apt-repository command
RUN apt-get -y install software-properties-common
RUN apt-get -y install locales poppler-utils

but it didn't change this.

I've tested it on Windows and it is working perfectly fine. The funny thing is that when I change FROM ubuntu:16.04 to FROM ubuntu:17.10 on MacOS it will also work without any problems so it seemed that somehow packages are taken not from 16.04 but 17.10 when I have FROM ubuntu:16.04

I've already:

  • restarted my Mac
  • restarted Docker
  • removed all data
  • reset to factory defaults
  • uninstalled and installed again Docker
  • downgraded from mac49 to 17.12.0-ce-mac46 [21698]
  • removed all images / containers and build them again

None of those change the thing. The strange is that it worked before on my MacOS [I've build images about 20-30 times before and it was fine] and also now maybe once every 100 times it would succeed now to build image but obviously this is not the best solution.

As a temporary workaround I've built all the images on Windows and pushed them to Docker hub and then pull them on MacOS but again this is only workaround and not the solution.

Chủ Đề