Couldn't download package from local repository for debian dists with nginx as a web server

150 views Asked by At

I created a local repository for downloading stretch debian dist and I used nginx as a web server for this. I downloaded all the files and dirs with wget --no-parent --recursive http://ftp.us.debian.org/debian/dists/stretch and placed them in /var/www/html but when I want to debootstrap my machine with this command debootstrap --include=systemd-container,curl stretch /var/lib/machines/m1 http://[my machine ip]/debian it gave me this error:

E: Couldn't download packages: libacl1 adduser libapparmor1 apt apt-utils libapt-inst2.0 .... 

and this warning(s):

I: Retrieving xxd 2:8.0.0197-4+deb9u3
W: Couldn't download package xxd (ver 2:8.0.0197-4+deb9u3 arch amd64)

I don't understand! what is the problem?

1

There are 1 answers

0
Clydog On

The problem is that with your wget command, you downloaded all the repository metadata (under /debian/dists/stretch), but the actual packages are in a different location (under /debian/pool), so you weren't providing debootstrap with a complete repository.

The Debian Wiki has a page that describes the 'Anatomy of a repository'. At the bottom of that page are some links to tools for working with repositories. Rather than using wget to copy an existing repo, I would recommend using software designed for mirroring and managing repos. I have successfully used Aptly and Artifactory for this purpose.