Updated to 11.1-U1 and pkg broken again in jails again

Dave Genton

Contributor
Joined
Feb 27, 2014
Messages
133
Cannot update or upgrade pkg in jails after update from 11.1 to 11.1-U1...

Contents of the /usr/local/etc/pkg/repos/FreeBSD.conf appears to be correct:
root@Syslog:/usr/local/etc/pkg/repos # more FreeBSD.conf
FreeBSD: {
url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
mirror_type: "srv",
enabled: yes
}

here is the output of a 'pkg update'
root@Syslog:/usr/local/etc/pkg/repos # pkg update
Updating FreeBSD repository catalogue...
pkg: Repository FreeBSD load error: access repo file(/var/db/pkg/repo-FreeBSD.sq
lite) failed: No such file or directory
[Syslog] Fetching meta.txz: 100% 944 B 0.9kB/s 00:01
[Syslog] Fetching packagesite.txz: 100% 6 MiB 3.1MB/s 00:02
Processing entries: 0%
pkg: Newer FreeBSD version for package gnome-desktop:
- package: 1101001
- running kernel: 1100122
pkg: repository FreeBSD contains packages for wrong OS version: FreeBSD:11:amd64
Processing entries: 100%
Unable to update repository FreeBSD
Error updating repositories!
root@Syslog:/usr/local/etc/pkg/repos #
 

Dave Genton

Contributor
Joined
Feb 27, 2014
Messages
133
ticket #27904
 

Skyfox

Explorer
Joined
Jul 15, 2013
Messages
50
Same problem here. According to the ticket mentioned above, you can upgarde the jails by following this https://www.cyberciti.biz/faq/how-to-upgrade-freebsd-jail-vps/
Not tried it yet, anyone had success with it?

Seems like you can just create a new jail, but it looks like they are changing how jails work with something called iocage (which can only be done via command line at the moment) so not sure I want to go recreating Jails if they are going to need recreating again soon.
 

dch

Cadet
Joined
Feb 18, 2018
Messages
2
TLDR your kernel and equivalent "signature" in packages need to match, and until pkg 1.10.5 lands in the appropriate mirrors, something like this is probably what you need. You'll need to work out what OSVERSION=... should be for your system, mine is 1200056 but yours should be 1100something. I'm guessing uname -KU or freebsd-version -ku run from the host system should answer that question for you.

Code:
# pull down latest package from FreeBSD repos even if its already present
/usr/sbin/pkg-static bootstrap -f
# force updating the newly bootstrapped package DB from FreeBSD again
/usr/local/bin/pkg -o OSVERSION=1100.... update -r FreeBSD -f
# and now we should be able to upgrade as usual
/usr/local/bin/pkg -o OSVERSION=1100.... upgrade -r FreeBSD


The info above comes from here - https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225104 - this is the upstream bug/issue. I'm not able to try this out atm but please post back how you get on with it.
 

Skyfox

Explorer
Joined
Jul 15, 2013
Messages
50
Thanks for that, worked!

I used uname -KU which gave me the version 1101505

then used pkg -o OSVERSION=1101505 update/upgrade and it updated perfectly.

Cheers!
 

IceBoosteR

Guru
Joined
Sep 27, 2016
Messages
503
Have the same issues but doesn't work for me. I am unable to download some packages. Seems to be non-existing anymore...
 

RSVP

Explorer
Joined
Feb 11, 2016
Messages
73
I believe this to be the root source of all my angst against freenas. I couldnt get plugins working. Jails keep breaking. So i tried to make my own jails, and when do pkg update i get the same error that is the original post. I have spent ages trying to get this right and feel its kind of a cop out for them to close this ticket and refer to a freebsd post. I am not sure how to fix this insallation. I would like to learn how instead of doing a fresh install. As I am not sure that even solves anything with how many issues been going on with 11.2
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
So you are running the wrong userspace for your kernel version? That's pretty normal and the reason switching to iocage was important. With iocage you can do the upgrade with iocage.
 

RSVP

Explorer
Joined
Feb 11, 2016
Messages
73
Nope doesn't work. If it was that simple I wouldnt be posting.
 
Top