Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

How I host a Devuan ceres mirror for myself

Building on what I learned a long time ago for building an apt repo on CentOS, and some guidance from the Devuan forum, I have now validated my local Devuan mirror. I chose to use debmirror because it can be limited to just certain suites (that's Debian-speak for "version") and package repositories. I exclusively use Devuan ceres (testing) because I need the FreeIPA packages. And also CentOS had an rpm of debmirror. I run my script on Sunday and weekdays. Cron job:

0   9   *   *   0-5 root    /etc/installed/debmirror-devuan.sh 1>/dev/null 2>&1

And my script:

1
2
3
4
5
#!/usr/bin/env sh
# File: /etc/installed/debmirror-devuan.sh
# Startdate: 2019-10-02 21:08
# Usage: by cron
{ debmirror --keyring /var/storage1/shares/public/Support/Platforms/devuan/keyrings/devuan-archive-keyring.gpg --verbose --config-file=/etc/debmirror.conf.devuan-ceres ; } 2>&1 | tee -a /var/storage1/shares/public/Support/Systems/storage1/var/log/debmirror/debmirror.devuan.$( date "+%F" ).log

Pretty basic, right? I had to prep the keyrings directory with the contents of a devuan install's /usr/share/keyrings, but calling the debmirror was pretty easy. I pipe it to some logging as well. Of course the debmirror.conf for this is extremely relevant.

# File: debmirror.conf.devuan-ceres
# Location: storage1:/etc/
# Author: bgstack15
# Startdate: 2019-09-27 22:43
# Title: Debmirror config for Devuan Ceres i386 and amd64 only
# Purpose: To provide a local mirror of devuan unstable so my clients can traverse only the local network
# History:
# Usage:
#    { time sudo debmirror --keyring /var/storage1/shares/public/Support/Platforms/devuan/keyrings/devuan-archive-keyring.gpg --verbose --config-file=/etc/debmirror.conf.devuan-ceres ; } 2>&1 | tee -a /var/storage1/shares/public/Support/Systems/storage1/var/log/debmirror/debmirror.devuan.$( date "+%F" ).log
# Reference:
#    https://dev1galaxy.org/viewtopic.php?id=1152
#    https://dev1galaxy.org/viewtopic.php?id=1571
#    https://duckduckgo.com/?q=devuan+debmirror
#    http://pkgmaster.devuan.org/devuan_mirror_walkthrough.txt
#    http://ftp.debian.org/debian/dists/sid/main/
#    http://pkgmaster.devuan.org/devuan/dists/ceres/
#    http://pkgmaster.devuan.org/merged/dists/ceres/
#    how to get working keyring https://ilostmynotes.blogspot.com/2008/05/debmirror-of-ubuntu-archive-validating.html
# Improve:
# Documentation:
#    To get the gpg keyring, copy d2-02a:/usr/share/keyrings/ to /mnt/public/Support/Platforms/devuan/keyrings.
#    This setup will copy all the debian+devuan packages into one devuan/ directory. No amprolla or apache rewrites are necessary.
# Location of the local mirror (use with care)
$mirrordir="/mnt/narcissus/mirror/devuan";

# Output options
$verbose=0;
$progress=0;
$debug=0;

# Download options
$host="packages.devuan.org";
$user="anonymous";
$passwd="anonymous@";
$remoteroot="merged";
$download_method="http";
@dists="ceres";
@sections="main,main/debian-installer,contrib,non-free";
@arches="i386,amd64";
# @ignores="";
# @excludes="";
# @includes="";
# @excludes_deb_section="";
# @limit_priority="";
$omit_suite_symlinks=0;
$skippackages=0;
# @rsync_extra="doc,tools";
$i18n=0;
$getcontents=1;
$do_source=1;
$max_batch=0;
# @di_dists="dists";
# @di_archs="arches";

# Save mirror state between runs; value sets validity of cache in days
$state_cache_days=0;

# Security/Sanity options
$ignore_release_gpg=0;
$ignore_release=0;
$check_md5sums=0;
$ignore_small_errors=0;

# Cleanup
$cleanup=0;
$post_cleanup=1;

# Locking options
$timeout=300;

# Rsync options
$rsync_batch=200;
$rsync_options="-aIL --partial";

# FTP/HTTP options
$passive=0;
# $proxy="http://proxy:port/";

# Dry run
$dry_run=0;

# Don't keep diff files but use them
$diff_mode="use";

# The config file must return true or perl complains.
# Always copy this.
1;

References

Weblinks

  1. How to mirror ascii? / Other Issues / Dev1 Galaxy Forum
  2. Make a mirror of devuan package repository with a modified debmirror / Documentation / Dev1 Galaxy Forum
  3. http://pkgmaster.devuan.org/devuan_mirror_walkthrough.txt
  4. http://ftp.debian.org/debian/dists/sid/main/
  5. http://pkgmaster.devuan.org/devuan/dists/ceres/
  6. http://pkgmaster.devuan.org/merged/dists/ceres/
  7. how to get working keyring: Technical notes, my online memory: Debmirror of ubuntu archive, with valid gpg keys

Web searches

  1. devuan debmirror

Comments