Solved pkg in iocage jail does not find packages known to exit

Caused by a forgotten modification to /etc/pkg/FreeBSD.conf.

This oddity showed up while I was trying to set up a jail as development sandbox. The jail's host is vhost01.

Code:
[root@vhost01 ~ (master)]# freebsd-version
12.1-RELEASE-p12
[root@vhost01 ~ (master)]# pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (101 candidates): 100%
Processing candidates (101 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.
[root@vhost01 ~ (master)]# pkg search openjdk
bootstrap-openjdk11-11.0.5.10.1 Java Development Kit 11
bootstrap-openjdk6-r450701     Java Development Kit 6
bootstrap-openjdk8-r450802_1   Java Development Kit 8
openjdk-7.261.02.1,1           Java Development Kit 7
openjdk-jre-7.261.02.1,1       Java Development Kit 7
openjdk11-11.0.8+10.1          Java Development Kit 11
openjdk11-jre-11.0.8+10.1      Java Runtime Environment 11
openjdk12-12.0.2+10.4_1        Java Development Kit 12
openjdk13-13.0.4+8.1           Java Development Kit 13
openjdk14-14.0.2+12.1          Java Development Kit 14
openjdk15-15.0.0+36.1_1        Java Development Kit 15
openjdk8-8.265.01.1            Java Development Kit 8
openjdk8-jre-8.265.01.1        Java Runtime Environment 8
rxtx-openjdk8-2.2p2_4          Native interface to serial ports in Java

[root@vhost01 ~ (master)]# jls
   JID  IP Address      Hostname                      Path

     4  192.168.18.124  sshpipe3.hamilton.harte-lyne. /zroot/iocage/jails/sshpipe3/root


But inside the jail most of the openjdk packages are not found:

Code:
[root@sshpipe3 ~]# freebsd-version
12.1-RELEASE-p12
[root@sshpipe3 ~]# pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (85 candidates): 100%
Processing candidates (85 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.
[root@sshpipe3 ~]# pkg search openjdk
bootstrap-openjdk6-r450701     Java Development Kit 6
bootstrap-openjdk8-r450802     Java Development Kit 8
openjdk-7.161.01,1             Java Development Kit 7
openjdk-jre-7.161.01,1         Java Runtime Environment 7
openjdk6-b45,1                 Oracle's Java 6 virtual machine release under the GPL v2
openjdk6-jre-b45,1             Oracle's Java 6 Runtime Environment under the GPL v2
openjdk8-8.181.13              Java Development Kit 8
openjdk8-jre-8.181.13          Java Runtime Environment 8
rxtx-openjdk8-2.2p2_4          Native interface to serial ports in Java

[root@sshpipe3 ~]# pkg info -x openjdk
pkg: No package(s) matching openjdk

Why is this?
 
try pkg update -f on host and jail and if you both follow the same repository (quarterly/latest?) the will show the same
 
Caused by a forgotten modification to /etc/pkg/FreeBSD.conf.
Don't modify this file. If you want to make changes (switch to latest for example) then create a /usr/local/etc/pkg/repos/FreeBSD.conf and put your changes in that. For example:
Code:
FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest"
}

If you want to figure out which repositories are enabled (or not), look at the output from pkg -vv, the configured repositories are at the end:
Code:
Repositories:
  FreeBSD: {
    url             : "pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/latest",
    enabled         : yes,
    priority        : 0,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }

try pkg update -f on host and jail and if you both follow the same repository (quarterly/latest?) the will show the same
Yes, if you muck around with repositories as much as I do it sometimes loses track and will show you old cached information. Just force the update, that almost always solves these problems.
 
Back
Top