saviodesign
Dabbler
- Joined
- Apr 7, 2017
- Messages
- 21
How to correct package update issues in a manual IOCAGE 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.
Sometimes you’ll notice that your application version is behind and what to update manually, in some cases the iocage jail decides to disagree and tell you your version is up to date. You do your due diligence and research the web a bit, including GitHub, Fresh Ports, and even Free BSD ( ) and you’ve come to find that you are version locked, and cannot update your system; this is not completely true, as the configuration files which dictate where to look for your ports and their updates are set incorrectly ( by default, and probably with good reason to secure the jails for novice users).
To correct this we need to tell the modify the config files to tell the jail that we’d rather police ourselves.
Note: If you’re looking to update an icoage plugin created jail, please click here:
https://forums.freenas.org/index.ph...pdates-issues-in-an-iocage-plugin-jail.72517/
How to Log into 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 | tautulli | up | 11.2-RELEASE | DHCP |
Next log in by entering:
iocage console jailname
e.g. iocage console plex , iocage console tautulli
Step 1: Grab an easy text editor, Disable default Repo, and Establish Alt Repo locations w/quick access
- Install Nano text editor (usually easier than navigating through VI editor) by running:
pkg install nano
- Create a new alternate port repository directory:
mkdir -p /usr/local/etc/pkg/repos
- Create shortcuts to get to these files in your home directory, we’ll label them repo1 and repo2
ln -s /etc/pkg ~/repo1
ln -s /usr/local/etc/pkg/repos ~/repo2
- Navigate to the current repo with the shortcut we created earlier
cd ~/repo1
- Open the config file with the text editor we acquired earlier (Nano)
nano FreeBSD.conf
Note: We never want to remove this file, only modify it
- Modify the URL line from:
url: "pkg+http://pkg.freebsd.org/${ABI}/latest",
to
url: "pkg+http://pkg.freebsd.org/FreeBSD:11:amd64/quarterly/",
hit ctrl+x to exit, then y for yes, then hit the enter key to save.
- Force update to change to a legacy repo
pkg update && upgrade
You should see something similar to the entries below:
Updating FreeBSD repository catalogue...
pkg: Repository FreeBSD has a wrong packagesite, need to re-create database
Once the update has finished let's edit the file and disable the default configuration
nano FreeBSD.conf
change the line “enabled: yes” to “enabled: no”
hit ctrl+x to exit, then y for yes, then hit the enter key to save
Your entries should look similar to the entries below:
FreeBSD: {
url: "pkg+http://pkg.freebsd.org/FreeBSD:11:amd64/quarterly/",
mirror_type: "srv",
signature_type: "fingerprints",
fingerprints: "/usr/share/keys/pkg",
enabled: no
}
Step 2: Create a New configuration and Forced update
Let’s navigate to the alternate repo you created earlier
cd ~/repo2
This time we’ll tell the editor to create the configure file for us after we submit our text entries
nano 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 ctrl+x to exit, then y for yes, then hit the enter key to save
- Finally, run forced updates
pkg update && upgrade
Your iocage jail should now be able to install from ports and accept updates.
- To test, try installing nano again and watch as the update occurs
pkg install nano
If update fail, please check your network connections ( ping pogle.com), review the steps above, or remove and install and start from scratch