Updating a FreeBSD 15.0 jail to FreeBSD 15.1 (via pkgbase)

On Friday, I finished upgrading all my FreeBSD hosts from FreeBSD 15 to FreeBSD 15.1 (the first host I did is in this blog post ).

Before that, I had run pkgbasify on each of those hosts.

I also ran pkgbasify in a jail, but I learned that I can run it from the host, using the -j parameter.

Today, I’m going to update that jail using pkgbase, from outside the jail.

In this post:

I am going to follow the above instructions, duplicating their section names here, for easier cross reference.

I will be running the commands on the host and using the -j parameter.

My commands will use the MYJAIL variable to make your copy/paste easier. Just adjust the export statement to reference your jail.

Introduction

[22:31 r730-03 dvl ~] % export MYJAIL=empty
[22:32 r730-03 dvl ~] % sudo pkg -j $MYJAIL which /usr/bin/uname
/usr/bin/uname was installed by package FreeBSD-runtime-15.0p11

Great. The jail has been pkgbasified. :)

Upgrading with Base System Packages

Snapshot the Current Installation

Well, since it’s a jail:

[22:35 r730-03 dvl ~] % zfs list | grep empty
data01/jails/empty                            41.4G  7.49T  37.2G  /jails/empty
[22:36 r730-03 dvl ~] % sudo zfs snapshot data01/jails/empty@pre-15.1
[22:36 r730-03 dvl ~] % 

Sorry, no variable used there.

Upgrade the Installed System

[22:36 r730-03 dvl ~] % sudo pkg -j $MYJAIL upgrade -r FreeBSD-base
Updating FreeBSD-base repository catalogue...
FreeBSD-base repository is up to date.
FreeBSD-base is up to date.
Checking for upgrades (1 candidates): 100%
Processing candidates (1 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.

Upgrade the Base System

Don’t issue this command. See below.

[22:38 r730-03 dvl ~] % sudo pkg -j $MYJAIL -oABI=FreeBSD:15:$(uname -p) -oOSVERSION=1501000 upgrade -r FreeBSD-base
Updating FreeBSD-base repository catalogue...
pkg: Repository FreeBSD-base has a wrong packagesite, need to re-create database
[empty.int.unixathome.org] Fetching meta.conf: 100%     179 B   0.2 kB/s    00:01    
[empty.int.unixathome.org] Fetching data: 100%    82 KiB  84.0 kB/s    00:01    
Processing entries: 100%
FreeBSD-base repository update completed. 509 packages processed.
FreeBSD-base is up to date.
Checking for upgrades (312 candidates): 100%
Processing candidates (312 candidates): 100%
The following 321 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        FreeBSD-pam: 15.1 [FreeBSD-base]
        FreeBSD-pam-dev: 15.1 [FreeBSD-base]
        FreeBSD-pam-dev-lib32: 15.1 [FreeBSD-base]
...
        FreeBSD-zoneinfo: 15.0p7 -> 15.1 [FreeBSD-base]

Installed packages to be REMOVED:
        FreeBSD-lldb-dev: 15.0

Number of packages to be removed: 1
Number of packages to be installed: 10
Number of packages to be upgraded: 311

The process will require 2 MiB more space.

Proceed with this action? [y/N]: y
Checking integrity... done (0 conflicting)
pkg: Package FreeBSD-cron has files with flags that cannot be managed in this jail. Set allow.chflags in the jail configuration.

AHH, I have to changeallow.chflags. If you review Running pkgbasify on a FreeBSD 15.0 jail, you’ll see I had to add this to the jail config:

    # added for pkgbasify
    allow.chflags;
    securelevel = -1;

I’ll do that, restart the jail, and try the same command again.

The full output is at: https://gist.github.com/dlangille/de625f5c50a66542567e8862c30da375

[22:41 r730-03 dvl ~] % sudo pkg -j $MYJAIL -oABI=FreeBSD:15:$(uname -p) -oOSVERSION=1501000 upgrade -r FreeBSD-base
Updating FreeBSD-base repository catalogue...
FreeBSD-base repository is up to date.
FreeBSD-base is up to date.
Checking for upgrades (312 candidates): 100%
Processing candidates (312 candidates): 100%
Checking integrity...
  - FreeBSD-zstd-15.1 [FreeBSD-base] conflicts with FreeBSD-utilities-15.0p11 [installed] on /usr/bin/unzstd
  - FreeBSD-clang-15.1p1 [FreeBSD-base] conflicts with FreeBSD-lldb-15.0p11 [installed] on /usr/lib/libprivatelldb.so.19
  - FreeBSD-pam-lib-15.1 [FreeBSD-base] conflicts with FreeBSD-runtime-15.0p11 [installed] on /usr/lib/libpam.so.6
  - FreeBSD-zstd-dev-lib32-15.1 [FreeBSD-base] conflicts with FreeBSD-runtime-dev-lib32-15.0p11 [installed] on /usr/lib32/libprivatezstd.a
  - FreeBSD-pam-lib32-15.1 [FreeBSD-base] conflicts with FreeBSD-runtime-lib32-15.0p11 [installed] on /usr/lib32/libpam.so.6
  - FreeBSD-pam-lib32-15.1 [FreeBSD-base] conflicts with FreeBSD-utilities-lib32-15.0p11 [installed] on /usr/lib32/pam_chroot.so
  - FreeBSD-zstd-lib32-15.1 [FreeBSD-base] conflicts with FreeBSD-runtime-lib32-15.0p11 [installed] on /usr/lib32/libprivatezstd.so.5
  - FreeBSD-zstd-lib-15.1 [FreeBSD-base] conflicts with FreeBSD-runtime-15.0p11 [installed] on /usr/lib/libprivatezstd.so.5
  - FreeBSD-pam-dev-lib32-15.1 [FreeBSD-base] conflicts with FreeBSD-runtime-dev-lib32-15.0p11 [installed] on /usr/lib32/libpam.a
  - FreeBSD-clang-dev-15.1p1 [FreeBSD-base] conflicts with FreeBSD-lldb-dev-15.0 [installed] on /usr/lib/libprivatelldb.so
  - FreeBSD-zstd-dev-15.1 [FreeBSD-base] conflicts with FreeBSD-runtime-dev-15.0p11 [installed] on /usr/include/private/zstd/zstd.h
  - FreeBSD-pam-15.1 [FreeBSD-base] conflicts with FreeBSD-runtime-15.0p11 [installed] on /etc/pam.d/README
  - FreeBSD-pam-15.1 [FreeBSD-base] conflicts with FreeBSD-utilities-15.0p11 [installed] on /usr/lib/pam_chroot.so
  - FreeBSD-pam-dev-15.1 [FreeBSD-base] conflicts with FreeBSD-runtime-dev-15.0p11 [installed] on /usr/include/security/openpam.h
Checking integrity... done (0 conflicting)
The following 322 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        FreeBSD-pam: 15.1 [FreeBSD-base]
        FreeBSD-pam-dev: 15.1 [FreeBSD-base]
        FreeBSD-pam-dev-lib32: 15.1 [FreeBSD-base]
        FreeBSD-pam-lib: 15.1 [FreeBSD-base]
        FreeBSD-pam-lib32: 15.1 [FreeBSD-base]
        FreeBSD-zstd: 15.1 [FreeBSD-base]
        FreeBSD-zstd-dev: 15.1 [FreeBSD-base]
        FreeBSD-zstd-dev-lib32: 15.1 [FreeBSD-base]
        FreeBSD-zstd-lib: 15.1 [FreeBSD-base]
        FreeBSD-zstd-lib32: 15.1 [FreeBSD-base]

Installed packages to be UPGRADED:
        FreeBSD-acct: 15.0 -> 15.1 [FreeBSD-base]

...

        FreeBSD-zlib-lib32: 15.0 -> 15.1 [FreeBSD-base]
        FreeBSD-zoneinfo: 15.0p7 -> 15.1 [FreeBSD-base]

Installed packages to be REMOVED:
        FreeBSD-lldb-dev: 15.0

Number of packages to be removed: 1
Number of packages to be installed: 10
Number of packages to be upgraded: 311

The process will require 2 MiB more space.

Proceed with this action? [y/N]: y
[empty.int.unixathome.org] [  1/327] Upgrading FreeBSD-bootloader from 15.0 to 15.1...
[empty.int.unixathome.org] [  1/327] Extracting FreeBSD-bootloader-15.1: 100%

...

[empty.int.unixathome.org] [326/327] Extracting FreeBSD-tests-dbg-15.1p1: 100%
[empty.int.unixathome.org] [327/327] Installing FreeBSD-set-tests-15.1...
==> Running trigger: mandoc.ucl
Generating apropos(1) database for /usr/share/man...
Generating apropos(1) database for /usr/share/openssl/man...
=====
Message from FreeBSD-local-unbound-15.1:

--
After upgrading local-unbound, the configuration file should be regenerated
by running "service local_unbound setup" before restarting the service.

Upgrade Third-party Kernel Modules

This is a jail, no need to do this, but it does run.

[22:45 r730-03 dvl ~] % sudo pkg -j $MYJAIL upgrade -r FreeBSD-ports-kmods
Updating FreeBSD-ports-kmods repository catalogue...
[empty.int.unixathome.org] Fetching meta.conf: 100%     179 B   0.2 kB/s    00:01    
[empty.int.unixathome.org] Fetching data: 100%    35 KiB  35.6 kB/s    00:01    
Processing entries: 100%
FreeBSD-ports-kmods repository update completed. 239 packages processed.
FreeBSD-ports-kmods is up to date.
Updating database digests format: 100%
Checking for upgrades (0 candidates): 100%
Processing candidates (0 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.
[22:45 r730-03 dvl ~] % 

Check for Failed Configuration Updates

[22:48 r730-03 dvl ~] % sudo jexec $MYJAIL find /etc /usr/local/etc -name '*.pkgnew' -ls 

Then, I didn’t trust that it did it right, so I did it again.

[22:49 r730-03 dvl ~] % sudo jexec $MYJAIL
[22:50 empty root ~] # find /etc /usr/local/etc -name '*.pkgnew' -ls
[22:50 empty root ~] # 

Upgrade the Boot Loader

This is a jail, nothing to do here.

Finish

I reversed the jail configuration changes I made above, and then did:

[22:51 r730-03 dvl ~] % sudo service jail restart $MYJAIL                                   
Stopping jails: empty.
Starting jails: empty.

Done

This seems right:

[22:52 empty dvl ~] % freebsd-version -ur
15.1-RELEASE-p1
15.1-RELEASE-p1
Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

Leave a Comment

Scroll to Top