I have an Ubuntu File Server, and I want to set up a Local Repo Server for the multiple Manjaro OSs I have on my LAN.
The info I have read on the Forum appears to be related to creating a Local Mirror on a Manjaro OS, using for example Pacserve, and similar Manjaro/Arch oriented tool.
What I want to know, is setting up a repo Mirror for Manjaro any more complicated than setting up a Web server and serving HTTP and or FTP, and syncing back to a public Mirror. Or are there specifics I need to know?
as @ mithrial says, that’s probably pacserve. I’ll go with setting up a Mirror on my File server. I have plenty of space, and I already have Apache running on it.
It will take a while 'cos of finding the time to concentrate on actually doing the job. It’s coming into Fire Season over here, so were pretty busy making sure only our Bush burns, and not the house.
My scenario was
VM’s, I run them one at a time, not simultaneously.
My only requirement is not to download all the updates multiple times for each of them but re-use them once they are present.
No need for the full repo and sharing the cache via pacserve would require more than one to be running at a time which is never the case.
You describe a scenario that is unique to you, and probably be too complicated for OP.
If your server is already running apache, then all you have to do is mirror one of the mirrors to any subdirectory of apache, and point your clients to this server.
… maybe
It’s a network mount - plenty of documentation on that.
It was just another way to do it.
And it avoids mirroring the whole mirror when only a few packages are actually needed. That is how I understood how pacserve works. But I’m not sure about that.
changed because only the pacman cache is shared
#!/bin/sh
# This is a simple mirroring script. To save bandwidth it first checks a
# timestamp via HTTP and only runs rsync when the timestamp differs from the
# local copy. As of 2016, a single rsync run without changes transfers roughly
# 6MiB of data which adds up to roughly 250GiB of traffic per month when rsync
# is run every minute. Performing a simple check via HTTP first can thus save a
# lot of traffic.
# EDIT to match your system
TARGET=/var/www/manjaro
# possible rsync mirrors
# https://wiki.manjaro.org/index.php/Manjaro_Mirrors
# https://forum.manjaro.org/t/root-tip-how-to-create-manjaro-mirror-server/21264#syncing-the-repo-from-another-mirror-17
#SOURCE="rsync://ftp.halifax.rwth-aachen.de/manjaro/"
SOURCE="rsync://mirror.easyname.at/manjaro/"
TMP="/var/tmp/manjaro"
LOCK="/tmp/rsync-manjaro.lock"
# NOTE: You'll probably want to change this or remove the --bwlimit setting in
# the rsync call below
BWLIMIT=100000
[ ! -d "${TARGET}" ] && mkdir -p "${TARGET}"
[ ! -d "${TMP}" ] && mkdir -p "${TMP}"
exec 9>"${LOCK}"
flock -n 9 || exit
## if we are called without a tty (cronjob) only run when there are changes
#if ! tty -s && diff -b <(curl -s "${STATE}") "${TARGET}/state" >/dev/null; then
# exit 0
#fi
if ! stty &>/dev/null; then
QUIET="-q"
fi
# excluded fh 2016-11-01
rsync -rtlvH --safe-links \
--bwlimit=${BWLIMIT} \
--delete-after --progress \
-h ${QUIET} --timeout=300 --contimeout=120 -p \
--delay-updates --no-motd \
--temp-dir="${TMP}" \
--exclude='/arm-stable' \
--exclude='/arm-testing' \
--exclude='/arm-unstable' \
--exclude='/pool/overlay-arm' \
--exclude='/pool/sync-arm' \
${SOURCE} \
"${TARGET}"
rm -f ${LOCK}
EOF
Run the script as root to do the initial sync - I don’t know how much the arm-repos are worth but I think a lot - and there’s no benefit from excluding branches as branch files - except database files - are symlinks to actual files in the pool.
If you have no need for the arm branches you can get down to around 90G only for x86_64 - I have modified the sync script to exclude arm.
When you have synced the repos - create a service and a timer
I am sorry to butt in like this when it was already solved but to me this is just too unnecessary and complicated with no good pros only cons,
I think it doesn’t make sense to make custom pool for just one local mirror,
I would just disable the timer and set in /etc/pacman.d/mirrorlist the local IP of the mirror
like so: Server = <protocol>://<local_IP>/<branch>/$repo/$arch
And it’s done
There is no need to keep using any kind of mirror helper(pacman-mirrors or shiny-mirrors), in such case it’s useless when you are going to use only one mirror.