How to Correct package updates issues in an IOCAGE Plugin JAIL

saviodesign

Dabbler
Joined
Apr 7, 2017
Messages
21
How to correct package update issues in an IOCAGE Plugin JAIL

Note: Always take your time, and remember that updates tend to have bugs.
Be sure to save your current OS version by setting the Keep flag in Systems > Boot Environments prior to updating, this way if things don't work how you'd like after an update, you can simply rollback to your previous OS by setting your previous OS version to active, then rebooting the machine.


How to Log in to an iocage jail

To log into the jail, first, you'll need to find your jail name by entering
iocage list

You’ll see something similar to the following:
+-----+----------+-------+--------------+------+
| JID | NAME | STATE | RELEASE | IP4 |
+=====+==========+=======+==============+======+
| 3 | plex | up | 11.2-RELEASE | DHCP |
+-----+----------+-------+--------------+------+
| 2 | transmission | up | 11.2-RELEASE | DHCP |
+-----+----------+-------+--------------+------+


Next log in by entering: iocage console jailname
e.g. iocage console transmission , iocage console plex


Step 1: Disable default Repo & Establish Alt Repo locations w/quick access

- Create a new alternate port repo(repository) and some shortcuts in your home directory for easy repo access
mkdir -p /usr/local/etc/pkg/repos

- Create shortcuts to both Current and Alternate port repository
ln -s /etc/pkg ~/repo1
ln -s /usr/local/etc/pkg/repos ~/repo2



- Navigate to current repo
cd ~/repo1

- Disable config to with the built-in easy editor (ee) allow the jail to use the alternate config
ee FreeBSD.conf

Modify the line “enabled: yes” to “enabled: no”
Hit esc to exit, then a for yes, then hit a to close and save the file.


Your entries should look similar the entries below:
FreeBSD: {
url: url: "pkg+http://pkg.freebsd.org/${ABI}/latest",
mirror_type: "srv",
signature_type: "fingerprints",
fingerprints: "/usr/share/keys/pkg",
enabled: no
}


Step2: Disable Plugin config to force manual jail config usage

- Navigate to the alternate repo you created earlier
cd ~/repo2

- back up old confifg
cp iocage-plugins.conf iocage-plugins.conf.old


- Disable config to with the built-in easy editor (ee) allow the jail to use the manual iocage config instead of plugin config
ee iocage-plugins.conf

change “enabled: true” to “enabled: false
Hit esc to exit, then a for yes, then hit a to close and save the file.


Your entries should look similar to the entries below:
iocage-plugins: {
url: "http://pkg.cdn.trueos.org/iocage/11.2-RELEASE",
signature_type: "fingerprints",
fingerprints: "/usr/local/etc/pkg/fingerprints/iocage-plugins",
enabled: false
}


Step 3: Create the New Repo config and force update
- Remove FreeBSD.conf file one exists
rm FreeBSD.conf

- Edit this file with the built-in easy editor (ee)
ee FreeBSD.conf

copy and paste the following:
FreeBSD: {
url: "pkg+http://pkg.freebsd.org/${ABI}/latest",
mirror_type: "srv",
signature_type: "fingerprints",
fingerprints: "/usr/share/keys/pkg",
enabled: yes
}


Hit esc to exit, then a for yes, then hit a to close and save the file.

- Next run pkg update && upgrade

You should see something similar to the entries below
Updating FreeBSD repository catalogue...
pkg: Repository FreeBSD load error: access repo file(/var/db/pkg/repo-FreeBSD.sqlite) failed: No such file or directory
[jailname] Fetching meta.txz: 100% 944 B 0.9kB/s 00:01
[jailname] Fetching packagesite.txz: 100% 7 MiB 620.9kB/s 00:11
Processing entries: 100%
FreeBSD repository update completed. 32843 packages processed.




Your iocage plugin jail should now be able to install from ports and accept updates from here.

- To test, try installing nano (another easy text editor)
pkg install nano

If updates fail, check your network connections ( ping pogle.com), review the steps above, or remove and install and start from scratch .
 
Top