Hosting APT repository on Windows using IIS?

Solution 1:

"406 Not Acceptable" is referencing a client issue by the apt client side. So add to your apt.conf: Debug::Acquire::Http "true";

You might then see Host headers something like this:

Host: 127.0.0.1
Cache-Control: max-age=0
Accept: text/*
If-Modified-Since: Thu, 23 Apr 2020 07:06:32 GMT
User-Agent: Debian APT-HTTP/1.3 (2.0.2ubuntu0.1)

This is saying the Release file is expecting "text/*" not "application/octet-stream"

If you have configured a default in IIS for "application/octet-stream" then it will fail with the error you are seeing. Change it to "text/plain" instead and you should get further.

Also if you use a virtual directory it appears you need to recreate the catch-all mime-type under the virtual directory as well as it doesn't seem to be inherited.