I created this tutorial because I often meet people using dinosaur-era versions of FreeBSD and when I need to do some work for them I spend hours upgrading. So today I am going to show you how to keep everything up to date.
I take no responsibility for any damage you may cause by using these commands, and I advise you to make a backup before anything else if you are not sure of what you are doing.
That said, unless you have a really old version, it is unlikely that you will break anything that can't be fixed.
PART A: Updating the Operating System
This being a Metin forum you may ask: what's the point of having an updated FreeBSD if Metin is some piss old thing?
Well, first and most obviously for security. Obsolete versions of the OS do not receive security patches. Second, for performance: opposite to what happens in the Windows world, in FreeBSD the latest software usually tends to be more stable and faster. And third for convenience, since it is not even possible to comfortably install anything if your O.S. is too old.
Within FreeBSD we can distinguish between major (e.g. 13) and minor (12.3) versions.
To check the current version of your FreeBSD, just use this command:
Code:
uname -a
FreeBSD myservercom 13.1-RELEASE FreeBSD 13.1-RELEASE releng/13.1-n250128-fc752ac2212 GENERIC amd64
The official FreeBSD web site () always informs in the front page of which versions are currently supported. This changes frequently, so always check it. Let's see what freebsd.org says today:
Depending on what our own version is and which ones are listed here, there are 3 possible scenarios:
1. We have a supported version
Let's say we already have 12.3. In this case, we could simply update our current version to its newest release, without the need to upgrade to a higher version number:
Code:
freebsd-update fetch install
2. Our major release is supported, but not the minor one
Before we start, I recommend to make the task easier to set the ee editor as the default editor for the system, since vi is quite complicated to use:
Code:
setenv EDITOR ee
Let's say we have version 12.1. In this case, it would be time to upgrade to, for example, version 12.3 which is the oldest supported version, and it is done in this way:
Code:
freebsd-update upgrade -r 12.3-RELEASE
"Does this seem reasonable? y/n"
In the absence of the knowledge to answer such a question, we can simply type y for yes and hope for the best.
If a system configuration file changes or we have made our own modifications to them it will ask us which one we want to keep, giving us the option to add or remove lines on our own (hence the text editor). This is called merging, and programmers should be familiar with this process.
If you aren't or you're not sure what to do, it's usually safe to accept the new changes, unless it's a file which we modified ourselves in which case w e should use our best judgement.
To accept the changes, move to every line starting with:
Code:
>>>>>>>>>>>> CURRENT VERSION
Code:
=======================
Once the download of the necessary files is finished, we may be asked to run freebsd-update install. It is also possible that we will be asked to reboot, and once we have rebooted we will probably have to run freebsd-update install once again. In any of the cases, I advise you to pay attention to what it says on the screen during the process, since I cannot predict here how a particular upgrade is going to be like.
3. We have an unsupported major version
Continuing with the example of the screenshot I took from freebsd.org - remember that this changes and you should check the current situation at the time - let's imagine now that we have version 11.3. Since no version 11 is supported anymore, it would be necessary to upgrade to version 12.3 at once. The procedure is exactly the same as described above with the following exceptions:
[LIST][*]Once the whole process is complete, we will be advised to reinstall the software we have installed through the ports. If you don't know what it is, or don't have it, you can just do a pkg update.
[*]Since this is a major update, it is possible that certain things may stop working, or work differently.
[*]We may be allowed to install newer versions of certain software than we were previously offered. We may not be able to install older versions that were previously available for our OS.
In case we find ourselves at a dead end and want to go back to the previous version, we can do a rollback:
Code:
freebsd-update rollback
By installed software I don't mean Metin but MySQL, nginx, php-fpm and other official software available through two methods:
- The package repository, providing precompiled binaries.
- The ports collection, which allows us to compile the code on our own and choose what we want and what we don't.
In the past, it was often necessary to resort to the ports system to install many things, as necessary features would not be compiled into the packaged binary. Nowadays, it is uncommon to need custom binaries, so I will skip that part.
Managing packages
Update everything we have on the system:
pkg update && pkg upgrade
At this point we will be told what will be removed, reinstalled or installed, depending on dependencies and so on. MariaDB users beware that there are packages that insist on installing MySQL instead of MariaDB! If you see any package giving such problems, you can either lock it with pkg lock <package> so that it will not be updated automatically, or install it through the ports system.
See the list of installed software
Code:
pkg info
pkg search <phrase to search>
example: pkg search mariadb
Install software
pkg install <software name>
example: pkg add tcptrack
Delete software
pkg delete <software>
example: pkg delete mysql56-server
Before we finish, let's talk about a particular case - what if we want to upgrade to a newer version of, for example, mysql or php?
The pkg upgrade command will not do this on its own. If we have MySQL 5.6, it will install the updates available for that version, and that's it. Just like with the operating system, if we want to upgrade to a newer version, we have to specify it.
If we have MySQL 5.6 and we want for example to install MySQL 8.0 we will have to do something like this:
Code:
pkg install mysql80-server
Code:
pkg delete mysql56-server mysql56-client
As I said in the system update section, pay attention to the text show in the screen after the update is finished because it informs us of possible problems, where the configuration files are (particularly if this location has changed) or what needs to be done after the installation for the software to work properly. This text is usually very short and to the point and very much worth reading.
Note: you can find more tutorials and eventually updated versions of this one in my .