# Local repository for freebsd-update



## balanga (Oct 23, 2022)

I have a number of systems running out of date versions of FreeBSD which I would like to upgrade, but before I do I would like to set up a local repository.

Any guidance on how to do that would be appreciated.

I've come across this - freebsd-update-server but don't know how accurate it is these days.


----------



## zirias@ (Oct 23, 2022)

Been there, and gave up.

IMHO:

If you use "stock" FreeBSD releases (no custom build options), just use the official servers. If you're worried about unnecessary WAN traffic, maybe a caching proxy might help.
If you build yourself with custom options, just share /usr/src and /usr/obj _read-only_ with NFS, and only execute the `make installkernel`/`make installworld` steps on the consuming systems. (edit: you have to distribute your /etc/src.conf, and possibly /etc/make.conf, to all the systems for that to work, build options must be the same for the build and install steps)
Other than that, hope for pkgbase to become production-ready


----------



## Alain De Vos (Oct 23, 2022)

I agree, It not worth the trouble.
Or share /usr/src & /usr/obj with sshfs or nfs or iscsi.
Or make tarballs of it.


----------



## W.hâ/t (Oct 23, 2022)

zirias@ said:


> Other than that, hope for pkgbase to become production-ready


Is that related to 'update-packages' in src?


----------



## zirias@ (Oct 23, 2022)

W.hâ/t said:


> Is that related to 'update-packages' in src?


I didn't have a look into pkgbase myself yet (not that I don't like experiments, but there are others more important to me ), but as it is already "implemented" in the build system of `src`, I'd say that's very likely!


----------



## W.hâ/t (Oct 23, 2022)

A simple search got me the answer... Should have started there
It is. PkgBase
Those tools FreeBSD devs give us! I love it!


----------



## balanga (Oct 23, 2022)

I just found this local mirror and am have a read through to see what is involved.

Any comments?...


----------



## SirDice (Oct 24, 2022)

balanga said:


> Any comments?...


Still works. Saves a lot of time. And best off all, you don't have to allow every server access to the internet for updates.

I now have a similar config for nginx, if you prefer to use that.

```
server {
      listen 192.168.X.X:80;
      server_name fbsd-update.example.com;

      root /var/cache/fbsd-update;

      access_log /var/log/nginx/proxy-access.log;

      location / {
        proxy_cache fbsdupdate_cache;
        proxy_cache_lock on;
        proxy_buffering on;
        proxy_http_version 1.1;
        proxy_cache_revalidate  on;
        proxy_cache_valid      200  7d;
        expires max;
        add_header X-Proxy-Cache $upstream_cache_status;

        proxy_pass http://update.freebsd.org;
      }
    }
```


----------

