# How to apply security patches and upgrade FreeBSD-STABLE ?



## macosxgeek (Sep 3, 2019)

Hi,

I'm running: 12.0-STABLE FreeBSD 12.0-STABLE r351060 GENERIC amd64

Recently I was trying to upgrade the system and apply latest security patches.. Unfortunately when I'm running: `freebsd-update fetch` I'm getting the following error message:


```
freebsd-update: Cannot upgrade from a version that is not a release
(including alpha, beta and release candidates)
using freebsd-update. Instead, FreeBSD can be directly
upgraded by source or upgraded to a RELEASE/RELENG version
prior to running freebsd-update.
Currently running: 12.0-STABLE
FAIL: 1
```

Can I ask what's the best way to patch and upgrade STABLE?


----------



## SirDice (Sep 3, 2019)

The only way is to build(7) from source.


----------



## obsigna (Sep 3, 2019)

macosxgeek said:


> Hi,
> 
> I'm running: 12.0-STABLE FreeBSD 12.0-STABLE r351060 GENERIC amd64
> 
> ...


I maintain FreeBSD CURRENT (now 13.0) on a BeagleBone Black, and building everything from source is out of question, because it would take several days. And by simply switching to a new snapshot, I would need to reinstall all my software and data, which would be also less than unideal. The solution is to track the snapshots this and then by copying only those parts from it which are needed. I wrote an article on my BLog how this works, s. Tracking FreeBSD CURRENT installations from Snapshots - https://obsigna.com/articles/1530995431.html.

While this deals with FreeBSD CURRENT on a BBB, it should work with minor adaptions for FreeBSD 12.0-STABLE on x86-64 machines as well, whose snapshots are available here: https://download.freebsd.org/ftp/snapshots/amd64/amd64/ISO-IMAGES/12.0/


----------



## SirDice (Sep 3, 2019)

This is on an AMD64 machine, building a full world takes about 2 hours on my old Core i5. But yeah, I did this once on Pi2. I think it took a full day to complete.


----------



## macosxgeek (Sep 3, 2019)

SirDice said:


> The only way is to build(7) from source.



Thank you. I will follow: Updating SRC then. And will see how it will work out for me.


----------



## macosxgeek (Sep 3, 2019)

obsigna said:


> I maintain FreeBSD CURRENT (now 13.0) on a BeagleBone Black, and building everything from source is out of question, because it would take several days. And by simply switching to a new snapshot, I would need to reinstall all my software and data, which would be also less than unideal. The solution is to track the snapshots this and then by copying only those parts from it which are needed. I wrote an article on my BLog how this works, s. Tracking FreeBSD CURRENT installations from Snapshots - https://obsigna.com/articles/1530995431.html.
> 
> While this deals with FreeBSD CURRENT on a BBB, it should work with minor adaptions for FreeBSD 12.0-STABLE on x86-64 machines as well, whose snapshots are available here: https://download.freebsd.org/ftp/snapshots/amd64/amd64/ISO-IMAGES/12.0/




The 'snapshot' method seems to be a bit complicated ;-) Don't get me wrong but I have decent i7 on my machine and I don't care about time really.. I will go with buildworld and kernel via SVN. 


Thank you !


----------



## SirDice (Sep 3, 2019)

macosxgeek said:


> I will follow: Updating SRC then.


Yes, that's correct. Make sure you get the correct sources if you initially installed from a snapshot. You'll need to fetch /base/stable/12.

If you've never done this before, beware of the mergemaster(8) step. Read every suggested change carefully as it's really easy to merge /etc/passwd (and associated files) incorrectly, which could potentially delete your user accounts and root passwords (been there, done that).


----------



## macosxgeek (Sep 4, 2019)

Just wanted to let you know guys that all went well.

I'm on: `FreeBSD 12.0-STABLE #0 r351740M` now and I'm very happy about it.

Thank you very much for all your help with this one!


----------



## ralphbsz (Sep 4, 2019)

May I ask a question: Why are you running a development beta-test version? Given that you are interested in "applying security patches", it seems that you are interested in a reliable, secure and stable FreeBSD platform. For that, you should be running the RELEASE version.

There may be good reasons to run CURRENT or STABLE: for example, if you are a developer yourself, or you want to perform a public service by testing early versions, or you need a specific new feature that is not generally available yet. But normally, folks should not be doing those things.


----------



## macosxgeek (Sep 5, 2019)

ralphbsz said:


> May I ask a question: Why are you running a development beta-test version? Given that you are interested in "applying security patches", it seems that you are interested in a reliable, secure and stable FreeBSD platform. For that, you should be running the RELEASE version.
> 
> There may be good reasons to run CURRENT or STABLE: for example, if you are a developer yourself, or you want to perform a public service by testing early versions, or you need a specific new feature that is not generally available yet. But normally, folks should not be doing those things.




I'm adventurous ;-)


I like to play around with stuff and experiment with it. Besides I was running RELEASE for ~2 years previously and after one of the upgrades I ended up with NIC driver being auto-magically replaced from 're' to 'em' (I have Realtek chipset based NIC). This caused many headaches and issues on my machine.. Eventually needed to re-install the server's OS.. I wanted to try something different this time..


----------



## quicktrick (Sep 19, 2022)

obsigna said:


> I maintain FreeBSD CURRENT (now 13.0) on a BeagleBone Black, and building everything from source is out of question, because it would take several days. And by simply switching to a new snapshot, I would need to reinstall all my software and data, which would be also less than unideal. The solution is to track the snapshots this and then by copying only those parts from it which are needed. I wrote an article on my BLog how this works, s. Tracking FreeBSD CURRENT installations from Snapshots - https://obsigna.com/articles/1530995431.html.
> 
> While this deals with FreeBSD CURRENT on a BBB, it should work with minor adaptions for FreeBSD 12.0-STABLE on x86-64 machines as well, whose snapshots are available here: https://download.freebsd.org/ftp/snapshots/amd64/amd64/ISO-IMAGES/12.0/


Hi obsigna,
Unfortunately, your article is not available. Could you post it somewhere else? For example, here.


----------



## W.hâ/t (Sep 27, 2022)

quicktrick said:


> Hi obsigna,
> Unfortunately, your article is not available. Could you post it somewhere else? For example, here.



https://obsigna.com/articles/1530995431.html

It is available to me. What's the error you get?


----------

