freebsd-upate on a LAN


Son of Beastie

Reaction score: 220
Messages: 4,052

Following guidance from SirDice I've cobbled together instructions on how to run freebsd-update() over a LAN rather than directly obtaining the update over the Internet. This would be particularly useful for anyone on a metered on slow connection. The assumption is that the Server has already been updated and the updates are held at /var/cache/freebsd-update/. The Client would simply run the usual freebsd-update -r 13.0-Release upgrade as normal.

To prepare Server (assumes Apache is not installed):-
pkg install -y apache24

sed -i '' -e 's/#LoadModule proxy_module/LoadModule proxy_module/
              s/#LoadModule proxy_module/LoadModule proxy_module/
              s/#LoadModule proxy_http_module/LoadModule proxy_http_module/
              s/#LoadModule cache_module/LoadModule cache_module/
              s/#LoadModule cache_disk_module/LoadModule cache_disk_module/' /usr/local/etc/apache24/httpd.conf

cat <<EOF >/usr/local/etc/apache24/Includes/freebsd-update.conf
<VirtualHost *:80>

        ProxyRequests Off
        ProxyPreserveHost Off

        <Proxy *>
          Require all granted

        ProxyPass /

        <Location />
                ProxyPassReverse /
                Require all granted

        <IfModule cache_module>
                <IfModule cache_disk_module>
                        CacheEnable disk /
                        CacheRoot /var/cache/freebsd-update/


sysrc apache24_enable=YES

service apache24 start
To prepare Client (IP 192.168.1.* should be changed to that of Server):-

sed -i '' 's/ServerName\nServername' /etc/freebsd-update.conf
echo '192.168.1.*' >> /etc/hosts

Hopefully freebsd-update -r 13.0-RELEASE upgrade run on the client will upgrade from the server with needing to access