I am trying to keep an offline machine (16.04 amd64 laptop) up to date by mirroring the Ubuntu software repositories. Unfortunately, I have a number of constraints beyond my control:
- Host machine (connected to internet) is CentOS 7. I don't have
apt-mirror
,debmirror
, or admin rights. I do havewget
,rsync
, and I have compiledlftp
Though I do have
rsync
, thersyncd.service
is not running.$ systemctl list-unit-files | grep rsync ... rsyncd.service disabled ...
So I'm not sure I can even use rsync using the instructions at the Rsyncmirror documentation according to this answer.
- Portable drive is only 1TB with ~850Gb free. I don't need any source code from the repos, just binaries, but even still, do I even have enough space?
- Slow network. Not really a constraint, but an annoyance. I have the ability to let this download go over a weekend or as long as it takes, but would prefer something that supports parallel downloads.
What I tried:
rsync -a --bwlimit=128 rsync://archive.ubuntu.com/ubuntu /media/mirror/ubuntu
This fails with the same errors as shown in the shown in this answer. I cannot startrsynd.service
without admin, so I think this is a no go.- Naive
wget --recursive http://se.archive.ubuntu.com/ubuntu/
. This pulls in way too much stuff and is pretty slow. Not sure of any way to filter out files I don't need or do any parallel downloading. lftp
. I think this is showing the most promise at the moment. For instance:$ lftp http://mirror.math.princeton.edu/pub/ubuntu/ cd ok, cwd=/pub/ubuntu lftp mirror.math.princeton.edu:/pub/ubuntu> mirror -n -parallel=10
works great, but of course is also just going to pull in everything. I can exclude whatever I want with
--exclude-glob
s (e.g.--exclude-glob "*trusty*/" --exclude-glob "*artful*/" --exclude-glob "*bionic*/" --exclude-glob "*precise*/" --exclude-glob "*.tar.gz"
), but what should I exclude to trim the size while still getting the contents to build a working repository.
I know that after I am done getting all of the packages I am going to have to actually make this a working repo by using dpkg-scanpackages
or something similar. I can do that from the offline laptop using Ubuntu/Debian tools, so that doesn't concern me as much. I really just want to get some advice on how to only download the packages which are relevant for my machine.