pkg base upgrade equivalent of freebsd-update

Well, I am impressed... Upgrading FreeBSD has never been so smooth... 🤯
In my experience the only non-smooth part of a base system upgrade was the annoyance of merging files in /etc.

etcupdate has made this really easy for source based upgrades, what happens with pkg?
 
  • Like
Reactions: mer
Hi everyone,

I'm trying to upgrade from freebsd-version #=> 15.0-RC4-p1 to 15.0-RELEASE on a pkgbase system. pkg update && pkg upgrade goes fine... However, the freebsd-version report is the same afterwards; ie it does not update to report 15.0-RELEASE or something to that effect, as I expected. My FreeBSD-base repo config file has the field
Code:
url : "pkg+https://pkg.freebsd.org/FreeBSD:15:amd64/base_release_0"
which I *think* is correct. I'm unsure if this is even as issue or not. Does anyone here have further information or diagnostic guidance?

Thanks!
Fixed my own issue. Apparently I had an additional repo conf file located at /usr/local/etc/pkg/repos/FreeBSD-base.conf which had it's fingerprints directory misconfigured. The system was updated by the pkgbasify script, which perhaps created this file erroneously? In any event it recorded the field
Code:
 fingerprints: "/usr/share/keys/pkg"
which I *think* was the issue; as the fingerprints directory is supposed to be /usr/share/keys/pkgbase-15. I simply commented the entire erroneous file out, so that the system would revert to using the configuration file located at /etc/pkg/FreeBSD.conf instead. Reran update and upgrade, and now the system is reporting version 15.0-RELEASE as it should.

Addendum: uname -r still reports 15.0-RC4-p1, which is a bit confusing. I think its fine though.
 
Addendum: uname -r still reports 15.0-RC4-p1, which is a bit confusing.
Better check freebsd-version -urk. Pay attention to the saved and running kernel versions. If these are different you should probably reboot. Everything should indicate "15.0-RELEASE".
 
Ok, the handbook seems to have been changed. It now reads


FreeBSD-base {
url = "pkg+https://pkg.freebsd.org/${ABI}/base_release_0";
mirror_type = "srv";
signature_type = "fingerprints";
fingerprints = "/usr/share/keys/pkg";
enabled = yes;
}


That seems to be a recent update in the handbook. Before, I think it was saying VERSION_MINOR. And keys are just in keys/pkg. (see the thread about keys in the wrong place https://forums.freebsd.org/threads/freebsd-base-has-a-wrong-packagesite.100546


Well, for now, I'm going to cowardly wait and see what happens to others.
I did upgrade a laptop in the usual way, with freebsd-update. That seemed to go smoothly, but firefox is now taking about 2 minutes to open and trying as a different use doesn't help. There's some error messges I'll have to investigate at some point, but I hardly use that laptop so I don't care that much. To answer the obvious questions, I did update all ports after upgrade and even tried reinstalling firefox from ports. When I'm ready to work on it, I'll keep and post error messges, probably in a different thread.
 
Ok, the handbook seems to have been changed. It now reads

FreeBSD-base {
url = "pkg+https://pkg.freebsd.org/${ABI}/base_release_0";
mirror_type = "srv";
signature_type = "fingerprints";
fingerprints = "/usr/share/keys/pkg";
enabled = yes;
}
No, unless you can point to any official late breaking changes and or SAs or ENs to the contrary.

As specified in FreeBSD.conf.quarterly-release - releng/15, on a 15.0-RELEASE the file /etc/pkg/FreeBSD.conf should be:
Code:
[1-0] # cat /etc/pkg/FreeBSD.conf
#
# To disable a repository, instead of modifying or removing this file,
# create a /usr/local/etc/pkg/repos/FreeBSD.conf file, e.g.:
#
#   mkdir -p /usr/local/etc/pkg/repos
#   echo "FreeBSD-ports: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf
#   echo "FreeBSD-ports-kmods: { enabled: no }" >> /usr/local/etc/pkg/repos/FreeBSD.conf
#
# Note that the FreeBSD-base repository is disabled by default.
#

FreeBSD-ports: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/quarterly",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
FreeBSD-ports-kmods: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_quarterly_${VERSION_MINOR}",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
FreeBSD-base: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/base_release_${VERSION_MINOR}",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkgbase-${VERSION_MAJOR}",
  enabled: no
}

This is the default 15.0-RELEASE setting that will give you access to quarterly packages from the ports tree.

If you have not selected the packaged base option (that is: "[Packages (Tech Preview)]") during installation of a 15.0-RELEASE, then to move to a packaged base, all you should have to do is enable the FreeBSD-base repository. Running the most up to date version of pkgbasify should give you the same result.

For enabling, all that is necessary is having as /usr/local/etc/pkg/repos/FreeBSD.conf:
Code:
FreeBSD-base: {
  enabled: yes,
}
 
I dont know about bastille. I just say it doesn't work with the pkg command. It's the same with env VERSION_MINOR=x pkg ....

By the way, what bastille does here? It's about the host system, not jail nor VM.

My point is that for the moment the pkgbase isn't mature. There was lately a breaking change and anothers are to be expected. There is no clear or simple command for the upgrade process. I think all of that will come.
Try that. But I use -o VERSION_MINOR=15 as opposed to env.
 
Try that. But I use -o VERSION_MINOR=15 as opposed to env.
Code:
$ cat /etc/pkg/FreeBSD.conf
(...)
FreeBSD-kmods: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_quarterly_${VERSION_MINOR}",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}

% uname -a
FreeBSD LxdeFreeBSD 14.3-RELEASE-p5 FreeBSD 14.3-RELEASE-p5 GENERIC amd64
% pkg -v
2.4.2

% pkg -o VERSION_MINOR=15 repos
(...)
FreeBSD-kmods: {
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:14:amd64/kmods_quarterly_3",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
 
Now that is interesting. I'm getting the same behaviour when trying to run those commands on my host. But when I do the same with Bastille, it works. I wonder if it has anything to do with the location of the conf files etc...

Code:
+ pkg --rootdir /usr/local/bastille/releases/15.1-RELEASE '--repo-conf-dir=/usr/local/share/bastille/pkgbase' -o 'IGNORE_OSVERSION=yes' -o 'VERSION_MAJOR=15' -o 'VERSION_MINOR=1' -o 'ABI=FreeBSD:15:amd64' -o 'ASSUME_ALWAYS_YES=yes' -o 'FINGERPRINTS=/usr/local/bastille/releases/15.1-RELEASE/usr/share/keys/pkgbase-15' update -r FreeBSD-base-release-1
pkg: Setting ABI requires setting OSVERSION, guessing the OSVERSION as: 1500000
Updating FreeBSD-base-release-1 repository catalogue...
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_1/meta.conf: Not found
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_1/meta.txz: Not found
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_1/data.pkg: Not found
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_1/data.tzst: Not found
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_1/packagesite.pkg: Not found
pkg: Failed to fetch https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_1/packagesite.tzst: Not found
Unable to update repository FreeBSD-base-release-1
Error updating repositories!
+ ERRORS=1
+ error_notify '[ERROR]: Failed to update repository: FreeBSD-base-release-1'
+ echo -e '\033[0;31m[ERROR]: Failed to update repository: FreeBSD-base-release-1\033[0;0m'
[ERROR]: Failed to update repository: FreeBSD-base-release-1

And the FreeBSD-base.conf file for Bastille

Code:
root@dev1:/usr/local/etc/pkg/repos #cat /usr/local/share/bastille/pkgbase/FreeBSD-base.conf
FreeBSD-base-latest: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/base_latest",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkgbase-${VERSION_MAJOR}",
  enabled: yes
}
FreeBSD-base-weekly: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/base_weekly",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkgbase-${VERSION_MAJOR}",
  enabled: yes
}
FreeBSD-base-release-0: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/base_release_0",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkgbase-${VERSION_MAJOR}",
  enabled: yes
}
FreeBSD-base-release-1: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/base_release_1",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkgbase-${VERSION_MAJOR}",
  enabled: yes
}
FreeBSD-base-release-2: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/base_release_2",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkgbase-${VERSION_MAJOR}",
  enabled: yes
}
FreeBSD-base-release-3: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/base_release_3",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkgbase-${VERSION_MAJOR}",
  enabled: yes
}
FreeBSD-base-release-4: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/base_release_4",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkgbase-${VERSION_MAJOR}",
  enabled: yes
}
FreeBSD-base-release-5: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/base_release_5",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkgbase-${VERSION_MAJOR}",
  enabled: yes

Notice that it doesn't actuall have the ${VERSION-MINOR} string inside the repo, but as you see from the code above, it does actually apply. The VERSION_MAJOR is only there so as not to polute the .conf file with too many repos. But I can confirm that it also applies properly.
 
VERSION_MAJOR is unaffected. The repo and even the fingerprint ending number are speficied in the command line:

+ pkg --rootdir /usr/local/bastille/releases/15.1-RELEASE '--repo-conf-dir=/usr/local/share/bastille/pkgbase' -o 'IGNORE_OSVERSION=yes' -o 'VERSION_MAJOR=15' -o 'VERSION_MINOR=1' -o 'ABI=FreeBSD:15:amd64' -o 'ASSUME_ALWAYS_YES=yes' -o 'FINGERPRINTS=/usr/local/bastille/releases/15.1-RELEASE/usr/share/keys/pkgbase-15' update -r FreeBSD-base-release-1
 
VERSION_MAJOR is unaffected. The repo and even the fingerprint ending number are speficied in the command line:

+ pkg --rootdir /usr/local/bastille/releases/15.1-RELEASE '--repo-conf-dir=/usr/local/share/bastille/pkgbase' -o 'IGNORE_OSVERSION=yes' -o 'VERSION_MAJOR=15' -o 'VERSION_MINOR=1' -o 'ABI=FreeBSD:15:amd64' -o 'ASSUME_ALWAYS_YES=yes' -o 'FINGERPRINTS=/usr/local/bastille/releases/15.1-RELEASE/usr/share/keys/pkgbase-15' update -r FreeBSD-base-release-1
VERSION_MAJOR is applied just fine. I tried (but didn’t share here) with 16 as the major version and it applied.
 
My hunch is that in a Bastille environment these cmd line option variables are pre-processed before they are passed to pkg.

All this seems underdocumented in pkg(8) and co. and or not working as documented.
It is indeed underdocumented. Doing so for the “PACKAGE_SITE” does not work at all, so…

Yes bastille preprocesses the variables, but still passes the with -o VERSION_MAJOR=15 or whoever release you are trying to bootstrap.
 
It is indeed underdocumented. Doing so for the “PACKAGE_SITE” does not work at all, so…

Yes bastille preprocesses the variables, but still passes the with -o VERSION_MAJOR=15 or whoever release you are trying to bootstrap.
And pkg does nothing with these vars (VERSION_MINOR and VERSION_MAJOR) as I showed to you. You even checked by yourself.

So... I won't explain once more. You and I are posting useless messages in this thread. Let's people focus on the real subject.
 
No, unless you can point to any official late breaking changes and or SAs or ENs to the contrary.

As specified in FreeBSD.conf.quarterly-release - releng/15, on a 15.0-RELEASE the file /etc/pkg/FreeBSD.conf should be:
Code:
[1-0] # cat /etc/pkg/FreeBSD.conf
#
# To disable a repository, instead of modifying or removing this file,
# create a /usr/local/etc/pkg/repos/FreeBSD.conf file, e.g.:
#
#   mkdir -p /usr/local/etc/pkg/repos
#   echo "FreeBSD-ports: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf
#   echo "FreeBSD-ports-kmods: { enabled: no }" >> /usr/local/etc/pkg/repos/FreeBSD.conf
#
# Note that the FreeBSD-base repository is disabled by default.
#

FreeBSD-ports: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/quarterly",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
FreeBSD-ports-kmods: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_quarterly_${VERSION_MINOR}",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
FreeBSD-base: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/base_release_${VERSION_MINOR}",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkgbase-${VERSION_MAJOR}",
  enabled: no
}

This is the default 15.0-RELEASE setting that will give you access to quarterly packages from the ports tree.

If you have not selected the packaged base option (that is: "[Packages (Tech Preview)]") during installation of a 15.0-RELEASE, then to move to a packaged base, all you should have to do is enable the FreeBSD-base repository. Running the most up to date version of pkgbasify should give you the same result.

For enabling, all that is necessary is having as /usr/local/etc/pkg/repos/FreeBSD.conf:
Code:
FreeBSD-base: {
  enabled: yes,
}

Please, would you mind to you explain why FreeBSD-ports is enabled and FreeBSD-base is disabled?

I was convinced that FreeBSD-base must be enabled... 🤯
 
I was convinced that FreeBSD-base must be enabled...
Hhm ... , that is exactly what I wrote:
[...]
If you have not selected the packaged base option (that is: "[Packages (Tech Preview)]") during installation of a 15.0-RELEASE, then to move to a packaged base, all you should have to do is enable the FreeBSD-base repository. Running the most up to date version of pkgbasify should give you the same result.

For enabling, all that is necessary is having as /usr/local/etc/pkg/repos/FreeBSD.conf:
Code:
FreeBSD-base: { 
  enabled: yes, 
}

Also, you have it as an option during installation:
  • [ Distribution Sets ]
    or
  • [Packages (Tech Preview)]
You do not have to install and run a packaged base 15.0-RELEASE.
I can't say it any clearer than that.
 
Erichans, you're right, I was wrong, there is no change in the handbook. I read the wrong section, but the section about major upgrades has the base_release_0. Fingerprints were /usr/share/keys/pkg.

On the one that I carelessly upgraded to 15-STABLE, I had an older BE that still had 14.3. So, using that one, I successfully upgraded to 15.0-RELEASE and everything is working but vm-bhyve, which for some reason had stopped working before the upgrade. Still not sure what I'll do with this machine, I may go for the fresh install anyway.
 
Concerning the change of VERSION_* vars by command line, I got a solution after a discussion with a guy on github freebsd/pkg.

In order to change the VERSION_* vars, you have to set OSVERSION and ABI (both of them on the same command line, otherwise that doesn't work).

Code:
$ pkg -o ABI=FreeBSD:15:amd64 -o OSVERSION=1500000 config OSVERSION
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
1500000

So, it opens the way to simple scripts or pkg aliases for OS upgrades. At least for RELEASE OS.

Note: VERSION_* are some sort of internal vars and don't even exist in the pkg env. I mean, you can't read them by pkg config. There is no point to define them with env or -o options.
 
VERSION_MAJOR is applied just fine. I tried (but didn’t share here) with 16 as the major version and it applied.
I suspect, wrt respect to VERSION_MAJOR, you allready have OSVERSION set to 16xxyyy explicitly or implicitly somewhere. Edit: implicitly, then most likely you are actually running 16.

Note: VERSION_* are some sort of internal vars and don't even exist in the pkg env. I mean, you can't read them by pkg config. There is no point to define them with env or -o options
You cannot set VERSION_MINOR (and VERSION_MAJOR) by setting them as such.

However, they seem derived from OSVERSION:
Rich (BB code):
[0-0] # grep '^[^#].*' /etc/pkg/FreeBSD.conf /usr/local/etc/pkg/repos/*.conf
/etc/pkg/FreeBSD.conf:FreeBSD-ports: {
/etc/pkg/FreeBSD.conf:  url: "pkg+https://pkg.FreeBSD.org/${ABI}/quarterly",
/etc/pkg/FreeBSD.conf:  mirror_type: "srv",
/etc/pkg/FreeBSD.conf:  signature_type: "fingerprints",
/etc/pkg/FreeBSD.conf:  fingerprints: "/usr/share/keys/pkg",
/etc/pkg/FreeBSD.conf:  enabled: yes
/etc/pkg/FreeBSD.conf:}
/etc/pkg/FreeBSD.conf:FreeBSD-ports-kmods: {
/etc/pkg/FreeBSD.conf:  url: "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_quarterly_${VERSION_MINOR}",
/etc/pkg/FreeBSD.conf:  mirror_type: "srv",
/etc/pkg/FreeBSD.conf:  signature_type: "fingerprints",
/etc/pkg/FreeBSD.conf:  fingerprints: "/usr/share/keys/pkg",
/etc/pkg/FreeBSD.conf:  enabled: yes
/etc/pkg/FreeBSD.conf:}
/etc/pkg/FreeBSD.conf:FreeBSD-base: {
/etc/pkg/FreeBSD.conf:  url: "pkg+https://pkg.FreeBSD.org/${ABI}/base_release_${VERSION_MINOR}",
/etc/pkg/FreeBSD.conf:  mirror_type: "srv",
/etc/pkg/FreeBSD.conf:  signature_type: "fingerprints",
/etc/pkg/FreeBSD.conf:  fingerprints: "/usr/share/keys/pkgbase-${VERSION_MAJOR}",
/etc/pkg/FreeBSD.conf:  enabled: no
/etc/pkg/FreeBSD.conf:}
/usr/local/etc/pkg/repos/FreeBSD.conf:FreeBSD-ports: {
/usr/local/etc/pkg/repos/FreeBSD.conf:    url:            "pkg+https://pkg.FreeBSD.org/${ABI}/latest",
/usr/local/etc/pkg/repos/FreeBSD.conf:    priority:       0,
/usr/local/etc/pkg/repos/FreeBSD.conf:    mirror_type:    "SRV",
/usr/local/etc/pkg/repos/FreeBSD.conf:    signature_type: "FINGERPRINTS",
/usr/local/etc/pkg/repos/FreeBSD.conf:    fingerprints:   "/usr/share/keys/pkg",
/usr/local/etc/pkg/repos/FreeBSD.conf:    enabled:        yes,
/usr/local/etc/pkg/repos/FreeBSD.conf:}
/usr/local/etc/pkg/repos/FreeBSD.conf:FreeBSD-ports-kmods: {
/usr/local/etc/pkg/repos/FreeBSD.conf:    url:            "pkg+https://pkg.FreeBSD.org/${ABI}/kmods_latest_${VERSION_MINOR}",
/usr/local/etc/pkg/repos/FreeBSD.conf:    priority:       0,
/usr/local/etc/pkg/repos/FreeBSD.conf:    mirror_type:    "SRV",
/usr/local/etc/pkg/repos/FreeBSD.conf:    signature_type: "FINGERPRINTS",
/usr/local/etc/pkg/repos/FreeBSD.conf:    fingerprints:   "/usr/share/keys/pkg"
/usr/local/etc/pkg/repos/FreeBSD.conf:    enabled:        yes,
/usr/local/etc/pkg/repos/FreeBSD.conf:}
/usr/local/etc/pkg/repos/FreeBSD.conf:FreeBSD-base: {
/usr/local/etc/pkg/repos/FreeBSD.conf:  enabled: yes,
/usr/local/etc/pkg/repos/FreeBSD.conf:}
[1-0] # pkg -vv | sed -nE -e '/(OSVERSION|ABI|BACKUP|DEBUG_LEVEL|CASE_SENSITIVE_MATCH)/ p' -e '/^Repositories:/,$ p'
DEBUG_LEVEL = 0;
CASE_SENSITIVE_MATCH = false;
IGNORE_OSVERSION = false;
BACKUP_LIBRARIES = true;
BACKUP_LIBRARY_PATH = "/usr/local/lib/compat/pkg";
ABI = "FreeBSD:15:amd64";
ALTABI = "freebsd:15:x86:64";
OSVERSION = "1500068";
Repositories:
  FreeBSD-ports: {
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/latest",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
  FreeBSD-ports-kmods: {
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/kmods_latest_0",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
  FreeBSD-base: {
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_0",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkgbase-15"
  }
[2-0] # pkg -o 'IGNORE_OSVERSION=true' -o 'ABI=FreeBSD:16:amd64' -o 'OSVERSION=1603000'  -vv | sed -nE -e '/(OSVERSION|ABI|BACKUP|DEBUG_LEVEL|CASE_SENSITIVE_MATCH)/ p' -e '/^Repositories:/,$ p'
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
DEBUG_LEVEL = 0;
CASE_SENSITIVE_MATCH = false;
IGNORE_OSVERSION = true;
BACKUP_LIBRARIES = true;
BACKUP_LIBRARY_PATH = "/usr/local/lib/compat/pkg";
ABI = "FreeBSD:16:amd64";
ALTABI = "freebsd:16:x86:64";
OSVERSION = "1603000";
Repositories:
  FreeBSD-ports: {
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:16:amd64/latest",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
  FreeBSD-ports-kmods: {
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:16:amd64/kmods_latest_3",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
  FreeBSD-base: {
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:16:amd64/base_release_3",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkgbase-16"
  }
[3-0] #
 
Concerning the change of VERSION_* vars by command line, I got a solution after a discussion with a guy on github freebsd/pkg.

In order to change the VERSION_* vars, you have to set OSVERSION and ABI (both of them on the same command line, otherwise that doesn't work).

Code:
$ pkg -o ABI=FreeBSD:15:amd64 -o OSVERSION=1500000 config OSVERSION
pkg: Warning: Major OS version upgrade detected.  Running "pkg bootstrap -f" recommended
1500000

So, it opens the way to simple scripts or pkg aliases for OS upgrades. At least for RELEASE OS.

Note: VERSION_* are some sort of internal vars and don't even exist in the pkg env. I mean, you can't read them by pkg config. There is no point to define them with env or -o options.
That’s makes sense, although it doesn’t appear to be so as I wrote that specific code in Bastille.

If you want to discuss further, I’d be happy to in a separate thread.
 
Back
Top