Friday, October 25, 2024

How to Upgrade FreeBSD 13.1 to 13.2 Release SIMPLE!

 FreeBSD 13.2-RELEASE, the third release of the stable/13 branches, was released on April 11, 2023. This article outlines the process of upgrading from FreeBSD 13.1 to 13.2 using the command line interface (CLI) over an SSH-based session.

Before you begin, it is crucial to make a backup of your FreeBSD system. This includes backing up all data, configuration files, and databases. Failure to do so could result in data loss.

Step 1: Update installed packages

The first step is to fetch and install any pending security updates for the FreeBSD 13.1 release. This can be achieved using the freebsd-update command:

freebsd-update fetch
freebsd-update install
    

If a new kernel was installed, you will need to reboot the FreeBSD system.

Step 2: Upgrade FreeBSD 13.1 to 13.2

After updating the packages, you can upgrade to FreeBSD 13.2-RELEASE using the following command:

      freebsd-update -r 13.2-RELEASE upgrade
    

This command will trigger a series of prompts about system changes. Review these changes carefully and make sure they look reasonable before confirming.

For instance, you may be prompted to manually edit files like /etc/passwd or /etc/ssh/sshd_config to resolve conflicts between the old and new versions. Ensure that you review the changes carefully before confirming them.

Step 3: Install the downloaded updates

Once you have resolved any conflicts, the system will present information about the files that will be removed, added, or updated during the upgrade. Review this information carefully.

To install the downloaded updates, execute the following command:

      freebsd-update install
    

The system will then install the kernel updates. After the kernel update is complete, you will need to reboot the system and run the freebsd-update install command again to finish installing the remaining updates.

Step 4: Upgrading packages for FreeBSD 13.2

After the system boots into the new FreeBSD 13.2 kernel, you need to upgrade the packages for the new release.

First, reinstall the pkg package:

      pkg-static install -f pkg
    

Then, update and upgrade the packages:

pkg update
pkg upgrade
    

Step 5: Verification

After the upgrade process is complete, verify that everything is working correctly. You can use the following commands to check the FreeBSD version, kernel version, and running services:

freebsd-version
uname -r
ps aux
sockstat -l
sockstat -4
sockstat -6
netstat -a -n | grep LISTEN
top
    

Step 6: Upgrading FreeBSD jails from 13.1 to 13.2

Upgrading FreeBSD jails to the 13.2 release is also a straightforward process.

First, obtain the list of running jails using the jls command.

Then, identify the jail path (e.g., /jails/gitserver).

Use the following command to upgrade the jail:

      freebsd-update -b /jails/gitserver/ --currently-running 13.1-RELEASE -r 13.2-RELEASE upgrade
    

After the upgrade process is complete, you can install the downloaded upgrades using the following command:

      freebsd-update -b /jails/gitserver/ install
    

Restart the jail:

      /etc/rc.d/jail restart
    

Finally, upgrade the packages inside the jail:

jexec 4 sh
pkg-static install -f pkg
pkg bootstrap -f
pkg update
pkg upgrade
    

If needed, clean the local cache of fetched remote packages:

pkg clean -n #<--Dry run and see what it does
pkg clean
    

Exit from the FreeBSD jail:

      exit
    

Summing up

Upgrading from FreeBSD 13.1 to 13.2 is a simple process that involves updating packages, upgrading the system, and verifying the upgrade.

Key features introduced in FreeBSD 13.2

  • OpenSSH version 9.2p1: This version includes security enhancements and bug fixes.

  • OpenSSL version 1.1.1t: This version also incorporates security improvements and bug fixes.

  • bhyve hypervisor support for more than 16 vCPUs: The bhyve hypervisor now allows you to create virtual machines with more virtual CPUs.

  • Address Space Layout Randomization (ASLR) enabled by default: ASLR is a security feature that helps prevent buffer overflow attacks.

  • OpenZFS version 2.1.9: This version brings new features and bug fixes to the OpenZFS file system.

  • Taking snapshots on UFS filesystems: You can now take snapshots of UFS filesystems, making data recovery easier.

  • Kernel WireGuard driver: The WireGuard driver is now included in the kernel, providing a secure and efficient VPN solution.

Additional considerations

  • FreeBSD ports: If you use FreeBSD ports, remember to upgrade them using the portsnap and portmaster commands.

  • IT automation tools: For managing multiple FreeBSD servers, consider using IT automation tools like Ansible or Puppet to streamline the upgrade process.

  • Log files: After the upgrade, check for errors in log files using the tail and grep commands to identify and resolve any issues.

By following these steps and reviewing the documentation, you can smoothly upgrade your FreeBSD systems to the latest release and enjoy its new features and improvements.

0 comments:

Post a Comment