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.

  • "Hash sum mismatch" is an issue between the server and client. It may be cause by either, both or neither (and instead by an intermediate party). The answers to the linked question deal with multiple problem sources on either side. If you still don't think that it's not a duplicate please [edit] your question to include 1) the output of sudo apt-get update and 2) a description of what exactly you tried and what happened. Thanks. – David Foerster May 06 '17 at 00:30
  • I solved this and the solution was two-fold. I had to insert [trusted=yes] in my sources list for my local repos, and I had to delete Release and InRelease files that were in the repos. Because this solution is different from all the answers on the other question, I think that this is not a duplicate. Part of the solution has to do with serverside configuration. – LINUX G33NYUS May 18 '17 at 18:46
  • I'm voting to reopen this question because the hash sum mismatch in it is related to a local repository and because OP claims to have found a solution. – David Foerster May 18 '17 at 21:49
  • @LINUXG33NYUS post the answer on the other question, then. – muru May 19 '17 at 08:44

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.