Pacman ignores local server after missing files

I have a slow internet connection and two manjaro computers, call them A and B.

I use A as a simple local server for installation files. A and B do not have identical sets of packages so sometimes packages are downloaded from remote server when B is updating (after A has updated and downloaded install packages over night).

But pacman on B stops using the local server after three (or so) files are missing from A and all other packages are downloaded from remote server. This is slow and a waste of internet bandwidth.

I can’t seem to find where pacman’s config file is to change this default value. Can this be changed to a higher number?

hard coded in source code :disappointed_relieved:

If so, why not just mirror the stable branch and maybe exclude big files you never need?

REPO=manjaro
BRANCH="stable"
ROOT="/media/data"
TARGET="${ROOT}/${REPO}/${BRANCH}"
TMP="${ROOT}/.tmp/${REPO}"

BWLIMIT=10m

SOURCE="rsync://mirror.atysleaks.org/${REPO}/${BRANCH}/"

[ ! -d "${TARGET}" ] && mkdir -p "${TARGET}"
[ ! -d "${TMP}" ] && mkdir -p "${TMP}"

rsync -rtlvH --safe-links --copy-links \
    --bwlimit=${BWLIMIT} \
    --delete-after --progress \
    --delay-updates --no-motd \
    --temp-dir="${TMP}" \   
    -h ${QUIET} --timeout=600 --contimeout=120 -p \
    "${SOURCE}" \
    "${TARGET}"

Then you don’t have to worry about future updates and with rsync the data is always 100% correct.

I scheduled such a script over night in the past as my internet connection slow … (6Mbit :rofl:, today 100Mbit )

or copy A file cache(after update) in B file cache (before update) ?

# speudo bash script in B machine
mount (samba?)A in /mnt/cacheA/
cp /mnt/cacheA/var/cache/pacman/pkg/*.{sig,zst} /var/cache/pacman/pkg/ --update
checkupdates -d    # so download files only if not in B cache
#TODO after update, paccache ...

thanks for the good advice; for now papajoke’s solution is easiest (but using rsync)

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.