FreeBSD 15.0 – after upgrade, installing my own packages

I build my own FreeBSD packages using poudriere. The chicken-and-egg situation: I can’t build FreeBSD 15.0 packages until I’m on FreeBSD 15.0 – and upgrading to FreeBSD 15 involves a step of upgrading all your packages before the final steps of the upgrade.

What do I do?

I disable my repos and enable the FreeBSD repos. If you’re using your own repos, you should already know how to do this.

In this post:

  • FreeBSD 15.0
  • fun & games

Swapping the repos around

At the end of a previous post (Updating my poudriere jail after updating the host to FreeBSD 15.0), the last step was starting a build of my FreeBSD packages. Today, I want to swap back to my own packages from the packages I installed [last night] from the FreeBSD project.

First step, toggle some enables. These are the now-active repos in my pkg01 jail:

[16:11 pkg01 dvl /usr/local/etc/pkg/repos] % pkg repos
FreeBSD-ports: { 
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/quarterly",
    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_quarterly_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         : no,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkgbase-15"
  }
local: { 
    url             : "https://fedex.int.unixathome.org/packages/FreeBSD:15:amd64/",
    enabled         : yes,
    priority        : 0,
    signature_type  : "PUBKEY",
    pubkey          : "/etc/ssl/slocum.unixathome.org.cert"
  }

Let’s look at this file:

[16:12 pkg01 dvl /etc/pkg] % cat 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
}

That matches up with some of the output from the previous command. Let’s disable two of those.

root@pkg01:~ # echo "FreeBSD-ports: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf
root@pkg01:~ # echo "FreeBSD-ports-kmods: { enabled: no }" >> /usr/local/etc/pkg/repos/FreeBSD.conf
root@pkg01:~ # pkg repos
FreeBSD-base: { 
    url             : "pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/base_release_0",
    enabled         : no,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkgbase-15"
  }
local: { 
    url             : "https://fedex.int.unixathome.org/packages/FreeBSD:15:amd64/",
    enabled         : yes,
    priority        : 0,
    signature_type  : "PUBKEY",
    pubkey          : "/etc/ssl/slocum.unixathome.org.cert"
  }
root@pkg01:~ # 

There, now it’s just base (disabled) and my local pkg repo server.

Swapping to the new packages

I’m going to run this command, just because I can. It’s not necessary, but sometimes I run it.

[16:10 pkg01 dvl /usr/local/etc/pkg/repos] % sudo pkg update -f
Updating FreeBSD-ports repository catalogue...
[pkg01.int.unixathome.org] Fetching meta.conf: 100%    179 B   0.2 k/s    00:01    
[pkg01.int.unixathome.org] Fetching data: 100%   10 MiB  10.8 M/s    00:01    
Processing entries: 100%
FreeBSD-ports repository update completed. 36667 packages processed.
Updating FreeBSD-ports-kmods repository catalogue...
[pkg01.int.unixathome.org] Fetching meta.conf: 100%    179 B   0.2 k/s    00:01    
[pkg01.int.unixathome.org] Fetching data: 100%   35 KiB  35.7 k/s    00:01    
Processing entries: 100%
FreeBSD-ports-kmods repository update completed. 239 packages processed.
Updating local repository catalogue...
pkg: Repository local has a wrong packagesite, need to re-create database
[pkg01.int.unixathome.org] Fetching meta.conf: 100%    179 B   0.2 k/s    00:01    
[pkg01.int.unixathome.org] Fetching data: 100%  343 KiB 351.3 k/s    00:01    
Processing entries: 100%
local repository update completed. 980 packages processed.
All repositories are up to date.

Now, I’m going to swap the packages over. These are the commands (kept in my git repo) I run to swap to a new pkg repo.

Get new pkg command

root@pkg01:~ # pkg-static install -f pkg
Updating local repository catalogue...
local repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be REINSTALLED:
	pkg-2.5.1 [local]

Number of packages to be reinstalled: 1

7 MiB to be downloaded.

Proceed with this action? [y/N]: y
[pkg01.int.unixathome.org] [1/1] Fetching pkg-2.5.1: 100%    7 MiB   6.9 M/s    00:01    
Checking integrity... done (0 conflicting)
[pkg01.int.unixathome.org] [1/1] Reinstalling pkg-2.5.1...
[pkg01.int.unixathome.org] [1/1] Extracting pkg-2.5.1: 100%
root@pkg01:~ # 

Reinstall all packages

root@pkg01:~ # pkg upgrade -f
Updating local repository catalogue...
local repository is up to date.
All repositories are up to date.
Checking for upgrades (130 candidates): 100%
Processing candidates (130 candidates): 100%
The following 129 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
	duf: 0.9.1_3 -> 0.9.1_4 [local]
	expat: 2.7.3 -> 2.7.4 [local]
...
	python: 3.11_3,2 -> 3.12_3,2 [local]

Installed packages to be REINSTALLED:
	SamDruckerClientShell-0.2.7 [local]
	abseil-20250127.1 [local]
	anvil-0.0.20 [local]
...
	xxhash-0.8.3 [local]
	zsh-5.9_5 [local]
	zstd-1.5.7_1 [local]

Number of packages to be upgraded: 19
Number of packages to be reinstalled: 110

149 MiB to be downloaded.

Proceed with this action? [y/N]: y

Then it fetches the needed packages:

Proceed with this action? [y/N]: y 
[pkg01.int.unixathome.org] [  1/128] Fetching net-snmp-5.9.5.2,1: 100%    2 MiB   2.6 M/s    00:01    
[pkg01.int.unixathome.org] [  2/128] Fetching png-1.6.54: 100%  305 KiB 312.6 k/s    00:01    
...
[pkg01.int.unixathome.org] [127/128] Fetching subversion-1.14.5_1: 100%    3 MiB   3.6 M/s    00:01    
[pkg01.int.unixathome.org] [128/128] Fetching lerc-4.0.0: 100%  176 KiB 180.6 k/s    00:01    

Does a check:

Checking integrity... done (0 conflicting)

Then installs:

[pkg01.int.unixathome.org] [  1/129] Reinstalling abseil-20250127.1...
[pkg01.int.unixathome.org] [  1/129] Extracting abseil-20250127.1: 100%
[pkg01.int.unixathome.org] [  2/129] Reinstalling anvil-0.0.20...
===> Creating groups
Using existing group 'anvil'
===> Creating users
Using existing user 'anvil'
===> Creating homedir(s)
[pkg01.int.unixathome.org] [  2/129] Extracting anvil-0.0.20: 100%
...
[pkg01.int.unixathome.org] [129/129] Extracting webp-1.6.0: 100%
You may need to manually remove /usr/local/etc/anvil/cert-puller.conf if it is no longer needed.
You may need to manually remove /usr/local/www/default_vhost_nginx/configuration/vhosts.conf if it is no longer needed.
...
[I've omitted all the pkg-message output here]

autoremove

Dependencies change. They are not automagically removed. Hence:

root@pkg01:~ # pkg upgrade
Updating local repository catalogue...
local repository is up to date.
All repositories are up to date.
Checking for upgrades (0 candidates): 100%
Processing candidates (0 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.
root@pkg01:~ # pkg autoremove
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages:

Installed packages to be REMOVED:
	python311: 3.11.14_1

Number of packages to be removed: 1

The operation will free 201 MiB.

Proceed with deinstalling packages? [y/N]: y
[pkg01.int.unixathome.org] [1/1] Deinstalling python311-3.11.14_1...
[pkg01.int.unixathome.org] [1/1] Deleting files for python311-3.11.14_1: 100%
root@pkg01:~ # 

Why is that being removed? Because I use python-3.12 at home:

root@pkg01:~ # pkg info -x python
python-3.12_3,2
python3-3_4
python312-3.12.12_3
rsync-python-3.4.1_6
root@pkg01:~ # 

Was everything updated?

I find this query useful because it means every package was updated. If the repo doesn’t have the installed package, it won’t get updated and will appear in this output. This is a future-problem solved. Detect the missing package[s] now, future you now has less work.

root@pkg01:~ # pkg query -a '%n %t' | awk -v t=$(date -v -6H +%s) '$2 < t { print $1 }'
Illegal variable name.
root@pkg01:~ # bash
[root@pkg01 ~]# pkg query -a '%n %t' | awk -v t=$(date -v -6H +%s) '$2 < t { print $1 }'
[root@pkg01 ~]# 

That command is meant for bash.

There. Now. Updated. Now I'm going to repeat this for the jail host.

Hope this helps.

Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

Leave a Comment

Scroll to Top