How to Update & Upgrade True/FreeNas Jails (Updated)

saviodesign

Dabbler
Joined
Apr 7, 2017
Messages
21
Some quick and dirty instructions on How to Update Jails and How to Upgrade Jails.

How to Update & Upgrade
True/FreeNas Jails



To Update target jails to Latest Release:

iocage update {jailname}
e.g.
iocage update plex


To Upgrade target jails to latest Version:

Note: TrueNas/FreeNas main must be updated prior to upgrading jail
To do this login via WebGUI.
From the left column navigate to System then Update and update the NAS OS.



-- Log into target via CLI and Stop Critical Services


Login

iocage console {jailname}

e.g.
iocage console Plex



Stop the service and exit the console

service {servicename} stop

e.g.
service plexmediaserver_plexpass stop

exit



-- Begin Upgrade of Jail Version


Upgrade target jail
iocage upgrade -r {RELEASE Name} {jailname}

e.g.
iocage upgrade -r 12.3 plex

Note
: This will take some time
- Type "y" for yes when inquiries occur

- Type "q" for "quit" when the validation list appears, you may need to type it several times depending on the number of affected items

- Type "y" for yes for any additional inquiries


-- Log into target Jail via CLI and Update Packages

pkg update && pkg upgrade
Note: This may take some time depending on the application version(s) installed and their dependencies


Exit Console and Restart jail

iocage restart {jailname}
e.g.
iocage restart plex



Validate your installations and you’re golden!


 
Last edited:

revoman

Dabbler
Joined
Jan 11, 2012
Messages
13
While reviewing these procedures for TrueNAS 13 I noticed a new feature of the iocage binary.

Instead of logging in to run pkg update && pkg upgrade -y
run this from outside the jail iocage update plex --pkgs

So far it seems to have the same effect.
Also, I found it necessary to restart before upgrading packages. So my procedure is

iocage upgrade -r 13.1-RELEASE plex
do the 'y', 'q', 'y' dance
iocage reset plex
iocage update plex --pkgs
 
Joined
May 2, 2017
Messages
211
I'm about to undertake the same series of updates on my system, and I've always been confused about this... So here is my plan, if you could verify I'm doing it correctly?

In the TrueNAS GUI, I update my primary system from TrueNAS-12.0-U8 to 13...

Then I upgrade my jails base version with "iocage upgrade -r {RELEASE Name} {jailname}"...

Then I update jail packages inside the jail with pkg update && pkg upgrade -y...

It's a bit confusing because I keep getting a notification in TrueNAS that there is a new version of a plug-in available, and there is an update button there under the plug-in. But I can't find for the life of me where to see what base version of the jail the plug-in requires. If my Emby plug-in requires 12.0 and I update the base jail to 13.0 things can go bad pretty quickly.

Any help on confirming what order I should do all this would be awesome.

Thanks,
Steven
 

vidx

Dabbler
Joined
Oct 16, 2021
Messages
40
Is there a benefit to upgrade a jail to the latest release? I upgraded Truenas 12 to 13 today, followed that with upgrading deluge jail but it failed and the webUI failed to load after that. I had to reinstall the plugin manually because the installation for the community plugin doesn't work either.

Now I dare not upgrade the other jails like Plex and Nextcloud for fear that something will go wrong.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Is there a benefit to upgrade a jail to the latest release?
FreeBSD has pretty aggressive EOL policies, such that if you aren't running on the latest release, you may find it difficult or even impossible to update packages in the jail.
I had to reinstall the plugin
Don't use plugins:
 

vidx

Dabbler
Joined
Oct 16, 2021
Messages
40
FreeBSD has pretty aggressive EOL policies, such that if you aren't running on the latest release, you may find it difficult or even impossible to update packages in the jail.

Don't use plugins:
Thanks! I'll try to update the jails from the command line. Fingers crossed
 

vidx

Dabbler
Joined
Oct 16, 2021
Messages
40
Code:
root@truenas[~]# iocage upgrade -r 13.1-RELEASE plex

Let's go!

Code:
Branch 13.1-RELEASE does not exist at https://github.com/freenas/iocage-plugin-plexmediaserver.git!
Using "master" branch for plugin, this may not work with your RELEASE
Running upgrade...
Checking integrity... done (0 conflicting)


Okayyyyyyyy... 13.1-RELEASE is not available for Plex.

Code:
WARNING: FreeBSD 13.0-RELEASE HAS PASSED ITS END-OF-LIFE DATE.


Wait, what?
 
Joined
May 2, 2017
Messages
211
So if the plug-in essentially creates the underlying jail, is there any issue with just taking control by just using the command line in the underlying jail? Essentially for those of us who have several functioning jails installed through the plug-in facility, can we just start interacting directly with the jail? Any caveats to that?

Plug-ins have been a source of never-ending confusion. I have them built, tweaked, and running... so I really don't want to start them all from scratch again just to make them a jail vs. a plug-in.
 

vidx

Dabbler
Joined
Oct 16, 2021
Messages
40
What if a jail refuses to upgrade?

Code:
root@truenas[~]# iocage upgrade -r 13.1-RELEASE reverseproxy
Looking up update.FreeBSD.org mirrors... 2 mirrors found.
Fetching metadata signature for 12.2-RELEASE from update1.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.

The following components of FreeBSD seem to be installed:
src/src world/base world/doc world/lib32

The following components of FreeBSD do not seem to be installed:
world/base-dbg world/lib32-dbg

Does this look reasonable (y/n)? y

Fetching metadata signature for 13.1-RELEASE from update1.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.
Fetching files from 12.2-RELEASE for merging... done.
Preparing to download files... done.
Attempting to automatically merge changes in files... done.

The following changes, which occurred between FreeBSD 12.2-RELEASE and
FreeBSD 13.1-RELEASE have been merged into /etc/freebsd-update.conf:
--- current version
+++ new version
@@ -1,6 +1,6 @@
-# $FreeBSD: releng/12.2/usr.sbin/freebsd-update/freebsd-update.conf 337338 2018-08-04 22:25:41Z brd $
+# $FreeBSD$

 # Trusted keyprint.  Changing this is a Bad Idea unless you've received
 # a PGP-signed email from <security-officer@FreeBSD.org> telling you to
 # change it and explaining why.
 KeyPrint 800651ef4b4c71c27e60786d7b487188970f4b4169cc055784e21eb71d410cc5
@@ -72,5 +72,8 @@
 # directory.
 # BackupKernelDir /boot/kernel.old

 # When backing up a kernel also back up debug symbol files?
 # BackupKernelSymbolFiles no
+
+# Create a new boot environment when installing patches
+# CreateBootEnv yes
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 13.1-RELEASE: /etc/motd
Does this look reasonable (y/n)? y
The following files will be removed as part of updating to
13.1-RELEASE-p2:
/boot/boot1.efifat
/boot/gptboot.efifat
/boot/lua/logo-beastie.lua
/boot/lua/logo-beastiebw.lua
/boot/lua/logo-fbsdbw.lua
/boot/lua/logo-orb.lua
/boot/lua/logo-orbbw.lua
/etc/amd.map
/etc/motd
/etc/newsyslog.conf.d/amd.conf
/etc/rc.d/amd
/etc/rc.d/nsswitch
/etc/rc.d/timed
/lib/casper/libcap_random.so.1
/lib/casper/libcap_sysctl.so.1
/lib/geom/geom_sched.so
/lib/libalias_cuseeme.so
/lib/libedit.so.7
/lib/libncurses.so.8
/lib/libncursesw.so.8
/lib/libufs.so.6
:


My reverseproxy jail hangs at a colon after /lib/libufs.so.6. Tried upgrading several times and each time it is the same.
 

Alecmascot

Guru
Joined
Mar 18, 2014
Messages
1,177
What if a jail refuses to upgrade?

Code:
root@truenas[~]# iocage upgrade -r 13.1-RELEASE reverseproxy
Looking up update.FreeBSD.org mirrors... 2 mirrors found.
Fetching metadata signature for 12.2-RELEASE from update1.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.

The following components of FreeBSD seem to be installed:
src/src world/base world/doc world/lib32

The following components of FreeBSD do not seem to be installed:
world/base-dbg world/lib32-dbg

Does this look reasonable (y/n)? y

Fetching metadata signature for 13.1-RELEASE from update1.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.
Fetching files from 12.2-RELEASE for merging... done.
Preparing to download files... done.
Attempting to automatically merge changes in files... done.

The following changes, which occurred between FreeBSD 12.2-RELEASE and
FreeBSD 13.1-RELEASE have been merged into /etc/freebsd-update.conf:
--- current version
+++ new version
@@ -1,6 +1,6 @@
-# $FreeBSD: releng/12.2/usr.sbin/freebsd-update/freebsd-update.conf 337338 2018-08-04 22:25:41Z brd $
+# $FreeBSD$

 # Trusted keyprint.  Changing this is a Bad Idea unless you've received
 # a PGP-signed email from <security-officer@FreeBSD.org> telling you to
 # change it and explaining why.
 KeyPrint 800651ef4b4c71c27e60786d7b487188970f4b4169cc055784e21eb71d410cc5
@@ -72,5 +72,8 @@
 # directory.
 # BackupKernelDir /boot/kernel.old

 # When backing up a kernel also back up debug symbol files?
 # BackupKernelSymbolFiles no
+
+# Create a new boot environment when installing patches
+# CreateBootEnv yes
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 13.1-RELEASE: /etc/motd
Does this look reasonable (y/n)? y
The following files will be removed as part of updating to
13.1-RELEASE-p2:
/boot/boot1.efifat
/boot/gptboot.efifat
/boot/lua/logo-beastie.lua
/boot/lua/logo-beastiebw.lua
/boot/lua/logo-fbsdbw.lua
/boot/lua/logo-orb.lua
/boot/lua/logo-orbbw.lua
/etc/amd.map
/etc/motd
/etc/newsyslog.conf.d/amd.conf
/etc/rc.d/amd
/etc/rc.d/nsswitch
/etc/rc.d/timed
/lib/casper/libcap_random.so.1
/lib/casper/libcap_sysctl.so.1
/lib/geom/geom_sched.so
/lib/libalias_cuseeme.so
/lib/libedit.so.7
/lib/libncurses.so.8
/lib/libncursesw.so.8
/lib/libufs.so.6
:


My reverseproxy jail hangs at a colon after /lib/libufs.so.6. Tried upgrading several times and each time it is the same.
It's waiting for a keypress to continue.
Can't remember which, maybe someone will be along shortly or you can try a few (not ctrl-c)
 

Alecmascot

Guru
Joined
Mar 18, 2014
Messages
1,177
It's waiting for a keypress to continue.
Can't remember which, maybe someone will be along shortly or you can try a few (not ctrl-c)
it's Q"or :Q if in VI.
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
So if the plug-in essentially creates the underlying jail, is there any issue with just taking control by just using the command line in the underlying jail? Essentially for those of us who have several functioning jails installed through the plug-in facility, can we just start interacting directly with the jail?

I can't speak for all plugins but mine were made with this in mind. For the years I successfully used iocage plugins, I had basically considered them jail install scripts with a convenient install button in the GUI - The only time I faced unexpected issues was trying to use the Plugin UPDATE button in the GUI
 

vidx

Dabbler
Joined
Oct 16, 2021
Messages
40
it's Q"or :Q if in VI.
Yes that did the trick! I was fiddling with it and pressed enter for it to go to the next line. I was on it for like 20 minutes only to find out that the spacebar page-down quicker until I found your answer to press Q!
 
Joined
May 2, 2017
Messages
211
I can't speak for all plugins but mine were made with this in mind. For the years I successfully used iocage plugins, I had basically considered them jail install scripts with a convenient install button in the GUI - The only time I faced unexpected issues was trying to use the Plugin UPDATE button in the GUI
So the relevant question right now is... How can I switch the repository not to use the iocage-plugins repository? We would basically need to have everything pull from the latest FreeBSD repos so pkg upgrade would update the OS and server software.
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
So the relevant question right now is... How can I switch the repository not to use the iocage-plugins repository? We would basically need to have everything pull from the latest FreeBSD repos so pkg upgrade would update the OS and server software.

I think most plugins already use the FreeBSD pkg repos - I'm not sure if it's set in some weird way when using a plugin but you can see this in the plugin's manifest. For example on line 39 of the homeassistant manifest

Code:
    "packagesite": "http://pkg.FreeBSD.org/${ABI}/latest",
 

Mattia3rd

Explorer
Joined
May 13, 2014
Messages
57
I'm about to undertake the same series of updates on my system, and I've always been confused about this... So here is my plan, if you could verify I'm doing it correctly?

In the TrueNAS GUI, I update my primary system from TrueNAS-12.0-U8 to 13...

Then I upgrade my jails base version with "iocage upgrade -r {RELEASE Name} {jailname}"...

Then I update jail packages inside the jail with pkg update && pkg upgrade -y...

It's a bit confusing because I keep getting a notification in TrueNAS that there is a new version of a plug-in available, and there is an update button there under the plug-in. But I can't find for the life of me where to see what base version of the jail the plug-in requires. If my Emby plug-in requires 12.0 and I update the base jail to 13.0 things can go bad pretty quickly.

Any help on confirming what order I should do all this would be awesome.

Thanks,
Steven
Thank you for sharing.

I also have a jail with Emby Server inside.
Did you tried to upgrade the TrueNAS versione inside o are you waiting ?
 
Joined
May 2, 2017
Messages
211
Thank you for sharing.

I also have a jail with Emby Server inside.
Did you tried to upgrade the TrueNAS versione inside o are you waiting ?

I upgrade rather carefully because I've had issues. The nice thing is a snapshot of the jail fixes most things. The issue I've found is that the repos are a bit behind, so Emby may say there is an update available, but you have to wait it drips down into the FreeBSD repos for a pkg upgrade to update it. Being a version or two behind is just the price of doing things in jails.

On the plus side, if something breaks in the newest release, you can read about it long before it's available to you in the jail... LOL
 
Top