Updating really old (9.3) jails: pkg breaks and I can't fix it.

Chatsubo

Cadet
Joined
Jul 4, 2020
Messages
7
After I got really bit hard by a previous upgrade and got gun shy for a number of years, I finally bit the bullet and updated my really ancient (~10?) Freenas system to Truenas 13. This didn't go without incident but I found my way to a (mostly) functioning Truenas 13 system. Still need to get my NFS shares to work again but that's another investigation for another day....

I did the migration script thing and once I got that working I was also able to update my jails to iocage. Which also seems to work mostly fine.

Jails/iocages that had been relatively up to date back when I stopped doing updates (10.3) seem to be a-ok (besides that they need updating too, another day...).

But jails that were still on 9.3 (turns out I had those, who knew?) have no networking. Fine, I picked a guiney pig and updated it to, say 10.x, and that works... but packages on those older versions are no longer available, also expected. So I go up to 13 .... Yay! However, when upgrading to 13, pkg (and many other things on the iocage) is now completely broken and I can see no way of fixing it (even after googling the internet to pieces and trying various things to get pkg up to date).

For instance:

root@sabnzbd_1:~ # pkg
ld-elf.so.1: Shared object "libssl.so.6" not found, required by "pkg"

This is where I went down a rabbit hole I'll spare the reader... save to say there's no way I can find to get the pkg on this system to "13 level". I seem to be in a quagmire of catch-22's. (Ports won't do anything until I upgrade pkg, and recommends "pkg-static install -f pkg", which fails to correct the problem, etc...)

Only other thing I notice is that both ports and pkg on the systems seem to think I'm still on 9.3. I don't know how they determine this.

TL;DR: How can I bring these old jails up to date without rebuilding lots of stuff from scratch?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
1. Are you sure you successfully upgraded your jail to 13.1?

uname -a tells you the system kernel version, not the FreeBSD version. freebsd-version inside the jail is the correct command.

2. Check the contents of /etc/pkg/FreeBSD.conf in the jail. Compare to an up to date system if available.

3. pkg-static install -f pkg
 

Chatsubo

Cadet
Joined
Jul 4, 2020
Messages
7
Hi Patrick, thanks for checking this out. Here's what happens (note the 9 in the repo it's trying to use):

root@sabnzbd_1:~ # freebsd-version
13.0-RELEASE-p13

root@sabnzbd_1:~ # cat /etc/pkg/FreeBSD.conf
# $FreeBSD$
#
# To disable this repository, instead of modifying or removing this file,
# create a /usr/local/etc/pkg/repos/FreeBSD.conf file:
#
# mkdir -p /usr/local/etc/pkg/repos
# echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf
#

FreeBSD: {
url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly",
mirror_type: "srv",
signature_type: "fingerprints",
fingerprints: "/usr/share/keys/pkg",
enabled: yes
}


root@sabnzbd_1:~ # pkg-static install -f pkg
pkg-static: Warning: Major OS version upgrade detected. Running "pkg-static install -f pkg" recommended
Updating FreeBSD repository catalogue...
pkg-static: http://pkg.FreeBSD.org/freebsd:9:x86:64/latest/meta.txz: Not Found
repository FreeBSD has no meta file, using default settings
pkg-static: http://pkg.FreeBSD.org/freebsd:9:x86:64/latest/packagesite.txz: NotFound
Unable to update repository FreeBSD
All repositories are up-to-date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be REINSTALLED:
pkg-1.5.4

Proceed with this action? [y/N]: y
[sabnzbd_1] [1/1] Reinstalling pkg-1.5.4...
[sabnzbd_1] [1/1] Extracting pkg-1.5.4: 100%
Message for pkg-1.5.4:
If you are upgrading from the old package format, first run:

# pkg2ng

root@sabnzbd_1:~ # pkg
ld-elf.so.1: Shared object "libssl.so.6" not found, required by "pkg"
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
1. Check if there is anything in /usr/local/etc/pkg/repos and delete that.
2. 13.0 is out of support, too. You need to upgrade your jails to 13.1 (iocage upgrade)
 

Chatsubo

Cadet
Joined
Jul 4, 2020
Messages
7
1. There was a conf in there specifying 9, removed, Progress!
2. I'm just trying to baseline this machine to be working before I upgrade the base OS again and break even more stuff. Please tell me that it's possible to at least get this version working first? (I'm on Truenas 13.0 right now, which is cutting edge compared to what I had)
root@sabnzbd_1:/var/db/pkg # pkg-static install -f pkg
pkg-static: Warning: Major OS version upgrade detected. Running "pkg-static install -f pkg" recommended
Updating FreeBSD repository catalogue...
pkg-static: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
[sabnzbd_1] Fetching meta.txz: 100% 916 B 0.9kB/s 00:01
pkg-static: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
repository FreeBSD has no meta file, using default settings
[sabnzbd_1] Fetching packagesite.txz: 100% 6 MiB 6.8MB/s 00:01
pkg-static: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
Unable to open created repository FreeBSD
Unable to update repository FreeBSD
All repositories are up-to-date.
pkg-static: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
pkg-static: Repository FreeBSD cannot be opened. 'pkg update' required
pkg-static: No packages available to install matching 'pkg' have been found in the repositories
root@sabnzbd_1:/var/db/pkg #
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
TrueNAS 13.0 is the current supported version. But TrueNAS 13.0 is built in FreeBSD 13-STABLE which is currently at 13.1. FreeBSD 13.0 is EOL. That means all packages are built for FreeBSD 13.1. They might work on 13.0 but then again might not.

So what I advised you to do is to upgrade your jails to FreeBSD 13.1 - not TrueNAS to anything past 13.0.
 

Chatsubo

Cadet
Joined
Jul 4, 2020
Messages
7
Alrighty then, upgraded jail to 13.1 and still have the same issue as my previous reply.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
You should always run pkg boostrap -f after upgrading a jails version. Try that followed by pkg upgrade and report back.
 

Chatsubo

Cadet
Joined
Jul 4, 2020
Messages
7
You should always run pkg boostrap -f after upgrading a jails version. Try that followed by pkg upgrade and report back.
Yup, that's what I was trying to do when this thing started. Was able... now that pkg doesn't think it's on v9, to bootstrap and upgrade. Finally!

Thanks all!
 
Top