nginxaptdpkg

Unable to download .deb in private apt repo


I am trying to setup a private apt repo using this. Have followed the instructions closely. After setting up everything sudo apt-get update works fine (I see Packages file being fetched from apt-repo) but when I try to install a package it fails(I downloaded .deb of haproxy using sudo apt-get -d install haproxy.

Err http://ec2-54-220-154-205.eu-west-1.compute.amazonaws.com/packages/ ./ haproxy 1.4.24-1
404  Not Found
Failed to fetch http://ec2-54-220-154-205.eu-west1.compute.amazonaws.com/packages//home/ubuntu/packages//h/haproxy_1.4.24-1_amd64.deb  404  Not Found

As you can see the URL to the deb package is incorrect.

This path (/home/ubuntu/packages//h/haproxy_1.4.24-1_amd64.deb) is read from Packages file which is generate by dpkg-scanpackages

dpkg-scanpackages ~/private /dev/null | gzip -9c > ~/private/Packages.gz.

(I am not 100% sure if it is a dpkg-scanpackages issue or a nginx config issue, my experience with nginx is not a whole lot).

Any help in trying to fix this would be great.

Thanks


Solution

  • Well in case some one else get stuck on something similar: I got it working, issue was that I was running dpkg-scanpackages from /home/ubuntu and hence the whole path was being added to the deb package in Packages.gz. I executed the same command from the packages dir and I am able to successfully download the pkgs.