# I Have Never Updated My FreeBSD Computer. Where to Start?



## Scribner (Apr 2, 2020)

Since installing FreeBSD 12.0-RELEASE in the summer of 2019 (thanks to the gracious help of this forum) and shortly thereafter installing Xfce and my only application, Firefox, I have not done any sort of updating on this computer. In other words, I have not upgraded to the current minor release, 12.1-RELEASE; updated to the latest patch levels; updated my one application, Firefox; or done any other update. I have basically just used this computer to browse the Web (especially freebsd.org).

If it wasn't obvious, I'm a noob.

So I was wondering where I should start in updating my computer. What is the sequence of updates you would recommend? Are there any updates I'm forgetting about? Keep in mind, in the future I plan on having more applications, such as LibreOffice, so if there's a way to update all of those at once, that would be great. One doesn't need to write out everything I need to do to upgrade to the latest minor release, for example. I have _Absolute FreeBSD (3rd Edition)_, so I should be fine figuring out how to do this stuff on my own.


----------



## rootbert (Apr 2, 2020)

usually the updates are quite smooth. I don't know your setup, but you could use *bectl *to create a snapshot of your current system (zfs is obligatory, see the man page). I also keep a separate /usr/local where the pkgs are installed (in your case xfce and firefox) - if you have a separate zfs dataset for /usr/local, just make a snapshot. https://www.freebsd.org/releases/12.1R/installation.html helps you on upgrading. So in case something goes wrong you can select your old boot environment at startup (the one you made with bectl), and if your applications won't work, just do a "zfs rollback" of your /usr/local.
So I would:
*) make a boot environment with bectl, and a snapshot of /usr/local (or maybe rsync the files somewhere)
*) do a base system upgrade as described in the link above. The upgrade process will advise you at some point to update the ports, so
*) you will do a "pkg update && pkg upgrade"

One advice: update your browser more frequently if you do banking or webmail or other important stuff with it.


----------



## unitrunker (Apr 2, 2020)

Use *bectl* to create a boot environment that you can revert back to if things go wrong.

*freebsd-update* to download and upgrade to 12.1-RELEASE.

*pkg update* to update your packages.

If you've built any ports, use *portsnap* to update your ports tree and then rebuild each port.


----------



## getopt (Apr 2, 2020)

Scribner said:


> If it wasn't obvious, I'm a noob.


Noobs are required to read the FreeBSD Handbook first:








						Chapter 25. Updating and Upgrading FreeBSD
					

Information about how to keep a FreeBSD system up-to-date with freebsd-update or Git, how to rebuild and reinstall the entire base system, etc




					www.freebsd.org


----------



## eternal_noob (Apr 2, 2020)

Scribner said:


> If it wasn't obvious, I'm a noob.


No way, i am the noob here. You're just too lazy to read the handbook.


----------



## Scribner (Apr 7, 2020)

I started by upgrading the packages and got these messages:


```
# pkg update && pkg upgrade
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%    916 B   0.9kB/s    00:01   
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
repository FreeBSD has no meta file, using default settings
Fetching packagesite.txz: 100%    6 MiB  71.8kB/s    01:30   
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
pkg: Repository FreeBSD load error: meta cannot be loaded No error: 0
Unable to open created repository FreeBSD
Unable to update repository FreeBSD
Error updating repositories!
```

Did I do something wrong?

Upon restarting Firefox, I can confirm that I am still running the same old version.


----------



## Sevendogsbsd (Apr 7, 2020)

Going out on a limb here but I believe because you are still on 12.0 and 12.0 is EOL, the repositories no longer exist so you are unable to update packages. 

I suggest you upgrade the base OS to 12.1 first, then update your packages. Look at the handbook: https://www.freebsd.org/doc/handbook/updating-upgrading-freebsdupdate.html, specifically the section on "23.2.3. Performing Major and Minor Version Upgrades".

After the OS is upgraded to 12.1, you can update the installed packages.


----------



## rootbert (Apr 7, 2020)

Scribner said:


> I started by upgrading the packages and got these messages:



thats why I suggested you start with the boot environment/snapshot and do the pkg stuff last...


----------



## gpw928 (Apr 7, 2020)

I upgraded from 12.0 to 12.1 yesterday without major issues.  That was on real hardware.

I see that some people are having difficulties with upgrading to FreeBSD 12.1 under VirtualBox, so further research is warranted in that situation.

My root on the 12.0 system has always been on a separate gmirror (inherited from an era before you could boot with zfs) in ufs format, so using boot environments was not an option.

I had a full backup, and did take a complete copy of /etc before starting, but didn't need any of that.  I use the generic kernel, so didn't have to worry about building a new kernel, or loading drivers after the update. 

I just followed the instructions for Performing Major and Minor Version Upgrades starting with `freebsd-update -r 12.1-RELEASE upgrade`.

You will be guided through the process, which took me about 8 hours (my Internet connection runs at 800 KB/sec max, but never got close to using that).  That included a final `pkg upgrade`, which replaced a lot of packages.

The only annoying part was being instructed to re-make all the ports (I assume so that old shared libraries can be abandoned).  All the ports distfiles had been deleted ages ago, and I was not completely sure what had been installed from ports.  [People will tell you not to mix ports and packages.  That's impractical advice, because some ports have to be made with non-default options selected.  But I will keep track of the /usr/ports/distfiles in future.]


----------



## SirDice (Apr 8, 2020)

Scribner said:


> I started by upgrading the packages and got these messages:


Update the base OS first, then do the packages.


----------

