> On Mon, 02 Nov 2026 16:50:48 +0100, > Leo Unglaub <[email protected]> wrote: > > > > Hey, > > what is the recommended/official way to define multiple mirrors? I > > want > > use the official mirror of course, but also two private mirrors that > > contain packages build with internal config files and software > > packages > > by our CI/CD. > > > > According to the man page for installurl only the last valid line is > > used, so i assume that's not the way yo go? > > > > My current version looks like > > $ cat /etc/installurl > > https://cdn.openbsd.org/pub/OpenBSD > > http://10.1.0.50/internal/OpenBSD > > scp://[email protected]/usr/config-packages > > > > What would be the correct way of doing this? > > Thanks!
I'm interested in this as well as I keep one location on the server rsynced with one of the official mirrors and in the other my custom built packages. Structuring packages like this means you have to run pkg_add for each of these locations. This is cumbersome and throws errors when trying to update packages that are only available from the other location. On Mon, 2026-11-02 at 18:28 +0100, Kirill A.Korinsky wrote: > A bit ugly but can work: > > env > PKG_PATH=http://10.1.0.50/internal/OpenBSD/%v/%a:installpath pkg_add > ... > > Here it checks 10.1.0.50 first, and after that uses mirror from > /etc/installurl > This is interesting. So "installurl" isn't where you set the mirror location, but is only a placeholder for "installpath" in "PKG_PATH" and that is used as a true list of mirrors. Then a correct way of setting this up would be something like: PKG_PATH=https://example.net/pub/Foo/%c/packages/%a:installpath Then you export the above variable (via your profile). This way calling pkg_add just once looks into both folders in all listed mirrors without doing anything extra. This saved me a lot of extra commands. Thanks for the tip!

