0

I have several apt repositories for different versions of Ubuntu, they are all pretty similar except for the one I just made for xenial servers. When a xenial server does an apt-get update and talks to my repo, it gets a "hash sum mismatch" error for Packages.gz. What could cause that?

I do not think that this is a duplicate of Trouble downloading packages list due to a "Hash sum mismatch" error because the answers there all assume that the problem is with the client, but in my case the problem is on the server, so no matter what you do on the client it doesn't fix the problem. Unsurprisingly, none of the answers to that question worked.

1 Answers1

0

There were 2 parts to getting this resolved.

  1. Using [trusted=yes] in the sources list on the client.
  2. Deleting the InRelease and Release files on the apt server.

If [trusted=yes] was not in the sources list on the client, then when doing an apt-get, it will complain that the apt server does not have a Release file if it's not there. If the Release file is there, then it will give an error saying

Unable to find expected entry 'Packages' in Release file (Wrong sources.list entry or malformed file).

The above error will also occur if [trusted=yes] is in the sources list but the repository contains InRelease and Release files.

In any of these cases, files for the server will be made in /var/lib/apt/lists/partial on the client, and the client's apt list will not be updated.

If both requirements are met, then all the client has to do is delete the files that were in /var/lib/apt/lists/partial and then do an apt-get update.