Solved Upgrading FreeBSD offline

Is there anyway to upgrade FreeBSD offline? By that, I mean is there any way to download the upgrade to a local repository and upgrade local systems from there rather than directly from freebsd.org?

I'm lucky enough to have a fast unmeterred link just now but won't have in a few days, and would like to upgrade several systems.
 
This post has a suggestion. Warning: I haven't tried it, so I can't say anything about it.
Also, I suspect that you would need a "copy" of your offline FreeBSD install as your download machine, or else you would risk missing some packages / bits.
 
If the freebsd-update(8) trick fails you could do a source upgrade. That only requires an up to date source tree. It'll take a lot longer of course but can be done completely offline.

After a major version upgrade you should also reinstall all the ports/packages too. But you could fetch those in advance and copy them from another machine for example.
 
Is there anyway to upgrade FreeBSD offline?

Maybe this will help you?

Upgrade FreeBSD with ZFS Boot Environments

If you have many systems installed the same way then this should help:

Code:
# rm -rf /var/db/freebsd-update
# freebsd-update upgrade -r 13.0-BETA3

Then replicate /var/db/freebsd-update directory between these systems with rsync(1) for example.

Then run these on all of these systems:

Code:
# freebsd-update install
# freebsd-update install
# pkg upgrade
# freebsd-update install

Hope that helps.
 
Would it possible keep this directory on a network and get each system to upgrade form there?
I've set up a caching proxy on my network to do exactly that. You can easily do this with nginx or Apache. The fist system will download the patches from the internet, the rest will get them from the cache. This speeds up the process considerably.
 
I've set up a caching proxy on my network to do exactly that. You can easily do this with nginx or Apache. The fist system will download the patches from the internet, the rest will get them from the cache. This speeds up the process considerably.
I found this:-
Thread 71748/post-435244
Does this still apply, or are any changes suggested?

Not sure how host names should be resolved...

Also do I need to make any changes to /etc/freebsd-update.conf on the client?
 
but not sure how host names should be resolved...
Internal DNS, or at least a DNS server you can add your own entries to it.

Also do I need to make any changes to /etc/freebsd-update.conf on the client?
Yes, change the ServerName and set it to fbsd-update.example.com (assuming the hostname from the example). Leave everything else as-is.
 
I created a /usr/local/etc/apache24/Includes/freebsd-update.conf in which I pasted your code from Thread 71748/post-435244 and ran service apache24 restart - and got this:-

Performing sanity check on apache24 configuration:
AH00526: Syntax error on line 5 of /usr/local/etc/apache24/Includes/freebsd-update.conf:
Invalid command 'ProxyRequests', perhaps misspelled or defined by a module not included in the server configuration
Do I need to add some module to make this work?
 
Do I need to run the following to enable this directive?

sed -i '' 's/#LoadModule proxy_module/LoadModule proxy_module/' /usr/local/etc/apache24/httpd.conf
 
Do I need to run the following to enable this directive?

sed -i '' 's/#LoadModule proxy_module/LoadModule proxy_module/' /usr/local/etc/apache24/httpd.conf
Wouldn't it be easier to just use the text editor of your choice to uncomment that one line? :oops:
 
Internal DNS, or at least a DNS server you can add your own entries to it.


Yes, change the ServerName and set it to fbsd-update.example.com (assuming the hostname from the example). Leave everything else as-is.
I've now added your code to my httpd.conf, enabled proxy-module and restarted apache.
On the client I have added
Code:
192.168.100.12<>update.FreeBSD.org update4.FreeBSD.org update3.FreeBSD.org update2.FreeBSD.org update1.FreeBSD.org.
to /etc/hosts (couldn't figure out if I could specify a catchall for update*.FreeBSD.org), Then ran freebsd-update -r 13.0-RELEASE upgrade and got this:-
Code:
src component not installed, skipped
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching metadata signature for 12.2-RELEASE from update4.freebsd.org... failed.
Fetching metadata signature for 12.2-RELEASE from update2.freebsd.org... failed.
Fetching metadata signature for 12.2-RELEASE from update1.freebsd.org... failed.
No mirrors remaining, giving up.

This may be because upgrading from this platform (amd64)
or release (12.2-RELEASE) is unsupported by freebsd-update. Only
platforms with Tier 1 support can be upgraded by freebsd-update.
See https://www.freebsd.org/platforms/index.html for more info.

Looks like something is missing...

The server's httpd-access.log shows:
Code:
192.168.100.46 - - [16/Apr/2021:10:58:16 +0100] "GET /12.2-RELEASE/amd64/latest.ssl HTTP/1.1" 500 529

Any ideas?
 
The Apache configuration from that example is a virtual host that listens on fbsd-update.example.com. Your freebsd-update(8) needs to connect to that hostname (that's how HTTP 1.1 works). Change example.com to your local domain, so it works for your situation.
 
The Apache configuration from that example is a virtual host that listens on fbsd-update.example.com. Your freebsd-update(8) needs to connect to that hostname (that's how HTTP 1.1 works). Change example.com to your local domain, so it works for your situation.
I changed /etc/hosts on the client to include
Code:
192.168.100.12<>fbsd-update.example.com
then,

freebsd-update -r 13.0-RELEASE upgrade:-
Code:
src component not installed, skipped
Looking up fbsd-update.example.com mirrors... none found.
Fetching metadata signature for 12.2-RELEASE from fbsd-update.example.com... failed.
No mirrors remaining, giving up.

This may be because upgrading from this platform (amd64)
or release (12.2-RELEASE) is unsupported by freebsd-update. Only
platforms with Tier 1 support can be upgraded by freebsd-update.
See https://www.freebsd.org/platforms/index.html for more info.

What is the metadata signature and where should it be?

I haven't touched /var/db/freebsd-update/ on the system which was upgraded. Looks like something is missing...
 
You do know how Apache virtual hosts work? Because the example is set up to specifically listen on fbsd-update.example.com.

What is the metadata signature and where should it be?
It shouldn't be anywhere because the virtual host configuration is set up to proxy every request to update.freebsd.org.
 
You do know how Apache virtual hosts work? Because the example is set up to specifically listen on fbsd-update.example.com.

Obviously not... I only pasted the example you provided into a /usr/local/etc/apache24/Includes/freebsd-update.conf. Didn't think anything else was required.

I did notice this in /var/log/httpd-error.log on the server:-

Code:
[Fri Apr 16 10:58:16.707654 2021] [proxy:warn] [pid 38957] [client 192.168.100.46:35229] AH01144: No protocol handler was valid for the URL /12.2-RELEASE/amd64/latest.ssl (scheme 'http'). If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

So maybe I need an extra module...
 
You'll need proxy_module and proxy_http_module. You probably also need to enable cache_module and cache_disk_module. I can't remember I set this up ages ago.
 
You'll need proxy_module and proxy_http_module. You probably also need to enable cache_module and cache_disk_module. I can't remember I set this up ages ago.
I added those four modules and things look working fine so far.

Many thanks for you help.
 
Oh, you also want to enable htcacheclean, or else your cache is going to go stale after some time. This should clean it up automatically:
Code:
htcacheclean_cache="/var/cache/freebsd-update/"
htcacheclean_enable="YES"
Assuming you used the same /var/cache/freebsd-update directory for the cache as the example I gave.
 
Back
Top