Solved Local repository for specific packages

Hello,

I need to enable a common repository for many FreeBSD servers, for some packages that are compiled with custom patches and options. On the server repository, where I compile the custom packages, I bump the minor version number.

I've added the repository to the all servers in /usr/local/etc/pkg/repos/local.conf

Code:
local: { url: "http://REPOSITORY_SERVER", mirror_type: "srv", enabled: yes, priority : 100 }

But I do not see package upgrades when I run pkg upgrade, it gives me only package upgrades from the official repository, not the local ones.

Only when I do :
Bash:
echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf
The updates appear, but the above command seems to disable all updates from the official repository.

How I can have both repositories enabled, where only higher version of a package is updated/installed?
 
Packages are annotated with the repository they are installed from and pkg will strongly prefer the repository they came from when they are available from multiple repositories regardless of the priority you assign to the repositories. This is part of the CONSERVATIVE_UPGRADE option in pkg (see pkg.conf(5)).

pkg upgrade -r local or pkg install -f -r local $packages should work. Next time the local repository should be preferred by pkg for the packages that were upgraded/installed, so you will only have to do this once.
 
I need to enable a common repository for many FreeBSD servers, for some packages that are compiled with custom patches and options.
Make sure all required packages are available on your custom repository and disable the official FreeBSD repository. That will prevent you from falling into a dependency hell.
On the server repository, where I compile the custom packages, I bump the minor version number.
Don't. Really. There's no need for it and this will cause problems when the original gets updated.
 
Back
Top