# when to update all ports



## noodlefling (Mar 22, 2013)

We're updating a machine from 7.4-RELEASE to 9.1-RELEASE.

Due to weirdness with the last update, we're going to 9.0-RELEASE as an intermediate stop before 9.1, using freebsd-update.

Is there any reason (or requirement) to update ports along the way to 9.1 (while the system is only very temporarily at 9.0), or is it best to just do proper base system upgrades until we get to 9.1, and then update all the ports only once with the version we actually intend on using?


----------



## kpa (Mar 22, 2013)

If you compiled everything on 9.0 from scratch there's no reason re-do it for 9.1. The binary compatibility guarantees that ports compiled on 9.0 will work on 9.1 without issues.


----------



## DutchDaemon (Mar 22, 2013)

When making that big a jump (from 7.x to 9.x if I read you correctly), you might be better off starting with a complete removal and fresh installation of all ports.

See the 11-step plan at the bottom of portmaster(8). Make sure to back up the configurations in /usr/local/etc/ (older man pages did not mention that).


----------



## noodlefling (Mar 22, 2013)

kpa said:
			
		

> If you compiled everything on 9.0 from scratch there's no reason re-do it for 9.1. The binary compatibility guarantees that ports compiled on 9.0 will work on 9.1 without issues.



We ran into a libraries issue last time that led us to believe 9.0 is not equivalent to 9.1.

Even if it were, is there any problem with waiting until we get to 9.1 before doing all the ports?



			
				DutchDaemon said:
			
		

> When making that big a jump (from 7.x to 9.x if I read you correctly), you might be better off starting with a complete removal and fresh installation of all ports.


I use portupgrade, but I was planning on doing a forced upgrade of all ports in any case.  I guess what you're saying is, I should make sure the config files are cleared out as well?

Either way, is there any problem with waiting until the system is stable at 9.1 before doing all the ports?  It'll take days to do it more than once.


----------



## DutchDaemon (Mar 22, 2013)

I've ditched portupgrade so long ago that I don't even remember if there's an equivalent. The portmaster method basically lets you remove the entire ports installation, including removing everything under /usr/local/*. which is why it would be of utmost importance to save your configuration files under /usr/local/etc/, of course. This way, you will never get bitten by lingering libraries or cyclical dependencies or ports that do not work under FreeBSD 9 anymore. It's a clean slate. I'm sure there's a way to do the same with portupgrade. All you need is to produce a list of top-level ports that you will need to install, pulling in their dependencies on the fly.


----------



## noodlefling (Mar 22, 2013)

OK, well regardless of which method we use, is there any reason/benefit/requirement to update ports at intermediate stages of a base system update?


----------



## DutchDaemon (Mar 22, 2013)

No, not really. Within major releases, it is unnecessary, between major releases you need to do it anyway to get to the latest release, so stopping at 8 and doing all the work there, just to hop to 9, or something like that, would be pointless. You could however install misc/compat7x and misc/compat8x along the way to make sure all libraries are present in the intermediate stages. Once you're up and running with 9, and have reinstalled all ports on it, deinstall them.


----------



## noodlefling (Mar 22, 2013)

Cool, thanks for the explanation!


----------



## kpa (Mar 22, 2013)

noodlefling said:
			
		

> We ran into a libraries issue last time that led us to believe 9.0 is not equivalent to 9.1.
> 
> Even if it were, is there any problem with waiting until we get to 9.1 before doing all the ports?



Two separate issues.

First, the base system libraries are guaranteed to stay compatible when going from 9.0 to 9.1, this is what I meant with binary compatibility.

Second, the binary compatibility does not cover shared libraries that are installed by applications (ports in other words). These are most likely the issues you ran into and they must be solved by recompiling the ports that affected by shared library version bumps.


----------



## noodlefling (Mar 27, 2013)

DutchDaemon said:
			
		

> You could however install misc/compat7x and misc/compat8x along the way to make sure all libraries are present in the intermediate stages. Once you're up and running with 9, and have reinstalled all ports on it, deinstall them.


Just so I understand clearly...if I install misc/compat7x after updating the base system, all the ports will magically continue working as they were on 7.4-RELEASE?

And then I can update all the ports at my leisure (so far it's taken over 24 hours to update all the ports on a test server) without worrying about compat7x mucking anything up?

And then I just deinstall compat7x and all is well?


----------



## DutchDaemon (Mar 27, 2013)

Yes. Same goes for misc/compat8x. Look at the pkg-plist.{arch} for both, and you'll see what they put where (they basically put older library versions at the end of your search path).


----------



## noodlefling (Apr 3, 2013)

Just finished working through the final issues with our last test server upgrade.  There was a delay before we had direct access to the server to go single user.

Now that we're preparing for the next server, a (hopefully) final question about misc/compat7x...

Can it be safely installed as a port pre-update?  That is, while the server is currently running 7.4?  So everything should work immediately upon the first reboot with the new base system?

Or should we wait until the base has been properly updated, and then load the misc/compat7x port?

We're trying to keep the rebooting down to a minimum.


----------



## kpa (Apr 3, 2013)

I think you'll have to update the base OS before you can install the compat package, it probably refuses to install on the same version of the OS it provides the compatibility for.


----------



## DutchDaemon (Apr 3, 2013)

It is indeed supposed to be installed on the next major version. However (and this is a careful, non-guaranteed however), if this is literally the last thing you do before rebooting (i.e. installing the port), you may get away with it. You can comment out the if statement requiring the next major version. In case you totally nuke your system, this post will magically disappear.


----------



## noodlefling (Apr 3, 2013)

OK, I won't tempt fate.  I'll wait until I update the base.

Thanks again, guys!


----------

