Updating 15.0-RELEASE-p9 to 15.1-RELEASE with PKGBASE... idw

Hi, I'm following the instructions which I'll detail here. The system uses PKGBASE but there's already an oddity with the first command:

Code:
custode ~ # pkg which /usr/bin/uname
/usr/bin/uname was installed by package FreeBSD-runtime-15.0p10

p10? `uname -a` shows: `FreeBSD my_hostname 15.0-RELEASE-p9 FreeBSD 15.0-RELEASE-p9 releng/15.0-n281048-6d536196f1bd GENERIC amd64`

Ok so we follow the next command from the update guide and let's throw in an 'update' for good measure:

Code:
# bectl create -r pre-15.1

# pkg update
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
Updating FreeBSD-ports-kmods repository catalogue...
FreeBSD-ports-kmods repository is up to date.
Updating FreeBSD-base repository catalogue...
FreeBSD-base repository is up to date.
All repositories are up to date.

# pkg upgrade -yr FreeBSD-ports pkg
Checking integrity... done (0 conflicting)
Your packages are up to date.

Ok...? So upgrade the base system:
Code:
bluesmx ~ # pkg -oABI=FreeBSD:15:$(uname -p) -oOSVERSION=1501000 upgrade -r FreeBSD-base
pkg: Repository FreeBSD-base has a wrong packagesite, need to re-create database
pkg: Repository FreeBSD-base cannot be opened. 'pkg update' required
Checking for upgrades (0 candidates): 100%
Processing candidates (0 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.

well i can do the whole loop again but the outcome doesn't change. It Doesn't Work™ (sorry). How do I continue?
 
I'll just be verbose in what I'm trying so it may help other people who are running into the same issues.

Code:
# freebsd-version -kru
15.0-RELEASE-p10
15.0-RELEASE-p9
15.0-RELEASE-p10

Apparently the running kernel is -p9 while the installed kernel and userland are -p10. So, reboot first, then check again:

Code:
# freebsd-version -kru
15.0-RELEASE-p10
15.0-RELEASE-p10
15.0-RELEASE-p10

That answers that question.
 
Next up, the following commands. We'll destroy and re-create the bectl snapshot because we rebooted just now.

Code:
# bectl destroy pre-15.1

# bectl create -r pre-15.1

# pkg update
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
Updating FreeBSD-ports-kmods repository catalogue...
FreeBSD-ports-kmods repository is up to date.
Updating FreeBSD-base repository catalogue...
FreeBSD-base repository is up to date.
All repositories are up to date.

# pkg upgrade -yr FreeBSD-ports pkg
Checking integrity... done (0 conflicting)
Your packages are up to date.

# pkg which /usr/bin/uname
/usr/bin/uname was installed by package FreeBSD-runtime-15.0p10

Now for the missing link! This command is not in the upgrading instructions:

Code:
# pkg -oABI=FreeBSD:15:$(uname -p) -oOSVERSION=1501000 update -f -r FreeBSD-base
Updating FreeBSD-base repository catalogue...
pkg: Repository FreeBSD-base has a wrong packagesite, need to re-create database
Fetching meta.conf: 100%     179 B   0.2 kB/s    00:01
Fetching data: 100%    82 KiB  83.8 kB/s    00:01
Processing entries: 100%
FreeBSD-base repository update completed. 509 packages processed.
FreeBSD-base is up to date.

# pkg -oABI=FreeBSD:15:$(uname -p) -oOSVERSION=1501000 upgrade -n -r FreeBSD-base
Checking for upgrades (485 candidates): 100%
Processing candidates (485 candidates): 100%
The following 499 package(s) will be affected (of 0 checked):
(list omitted)

Dry run looks okay, let's try to upgrade:

Code:
# pkg -oABI=FreeBSD:15:$(uname -p) -oOSVERSION=1501000 upgrade -r FreeBSD-base
(a large list of packages is upgraded after I confirm)

Next to try is:
Code:
# pkg upgrade -r FreeBSD-ports-kmods
pkg: Repository FreeBSD-ports-kmods has a wrong packagesite, need to re-create database
pkg: Repository FreeBSD-ports-kmods cannot be opened. 'pkg update' required
Checking for upgrades (0 candidates): 100%
Processing candidates (0 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.

Wrong package site? argh. Let's force it anyway.

Code:
# pkg update -f -r FreeBSD-ports-kmods
Updating FreeBSD-ports-kmods repository catalogue...
pkg: Repository FreeBSD-ports-kmods has a wrong packagesite, need to re-create database
Fetching meta.conf: 100%     179 B   0.2 kB/s    00:01
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.

# pkg upgrade -r FreeBSD-ports-kmods
Checking for upgrades (0 candidates): 100%
Processing candidates (0 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.

Looks good to me, because we have no third party kernel modules. Let's see if we need to update files in /etc
Code:
# find /etc /usr/local/etc -name '*.pkgnew' -ls

For me the list is empty but ymmv. Now, let's look at the machine's boot method:
Code:
# sysctl machdep.bootmethod
machdep.bootmethod: UEFI

Here YMMV as well. But I guess most people have UEFI these days. My system is a VPS at a large provider and so we have to take care not to mess things up with the boot. First, let's look at the efibootmgr output, and the partition layout. Do we have an efi partition? and is it mounted?

Code:
# efibootmgr -v
Boot to FW : false
BootCurrent: 0001
Timeout    : 0 seconds
BootOrder  : 0001, 0000, 0002
+Boot0001* UEFI QEMU QEMU HARDDISK  PciRoot(0x0)/Pci(0x4,0x0)/Scsi(0x0,0x0)
 Boot0000* UiApp Fv(...)/FvFile(...)
 Boot0002* EFI Internal Shell Fv(...)/FvFile(...)

Unreferenced Variables:

# gpart show
=>       34  157286326  da0  GPT  (75G)
         34        348    1  freebsd-boot  (174K)
        382      66584    2  efi  (33M)
      66966    2097152    3  freebsd-swap  (1.0G)
    2164118       2048    4  freebsd  (1.0M)
    2166166  155120194    5  freebsd-zfs  (74G)

# mount | grep boot/efi
/dev/gpt/efiboot0 on /boot/efi (msdosfs, local)
Ok, so efi is mounted. Let's see what we can find in terms of files and directories:

Code:
# find /boot/efi -maxdepth 3 -type f
/boot/efi/EFI/BOOT/bootx64.efi

# find /boot/efi -maxdepth 3 -type d
/boot/efi
/boot/efi/EFI
/boot/efi/EFI/BOOT

So, we just have the "fallback" bootloader, which is pretty standard for these types of systems. Let's copy over the newer replacement:

Code:
#  cp -i /boot/loader.efi /boot/efi/EFI/BOOT/bootx64.efi
overwrite /boot/efi/EFI/BOOT/bootx64.efi? (y/n [n]) y

And, with fingers crossed, and toes too, reboot.
 
So, we rebooted, the system came back up, let's have a look:
Code:
$ uname -a
FreeBSD myhostname 15.1-RELEASE FreeBSD 15.1-RELEASE releng/15.1-n283562-96841ea08dcf GENERIC amd64

And now we can continue to upgrade as usual with pkg upgrade.

I will admit that freebsd-update was a bit easier... but I understand why PKGBASE might be the future - out of scope for this topic though.
 
Back
Top