FreeBSD14 ; Initial setting (Update binaries, Packages and Ports Collection)

First do the following

After installing FreeBSD, we will start building the server, but it is difficult to work on the console screen, so we will change the SSH connection settings for now in order to operate the server from Windows using TeraTerm or other software.
Enter the following command on the FreeBSD console screen
# vi /etc/ssh/sshd_config
Line 61.
#PasswordAuthentication no → PasswordAuthentication yes Make the changes and reflect the settings with the following command
# service sshd restart
Now you can connect via SSH from TeraTerm on Windows (see the default settings for other operating systems for settings in TeraTerm).

1. Binary Update

Display of kernel and other version information

Get all available binary updates (security updates)
There was no update this time

Install updates or upgrades

Restart the server to boot with the installed image

Check for updated version

2. Update Packages and Ports Collection

2.1 Package system (pkgng) first run configuration

①Initial run configuration

➁confirmation
OK when the list of installed packages appears.

2.2 Update Packages

PACKAGES can use the pkg command to install applications without requiring compilation. However, packages alone cannot install all applications. Dependencies can get in the way and cause necessary applications to be removed

2.3 Installing packages

Use pkg-install to install binary packages
To install curl as an example

Installed packages and additional packages installed as dependencies can be found in the list of installed packages

2.4 Obtaining information about installed packages

For example, to get information about the curl you just installed

2.3 Ports Collection Install

Since portsnap has been removed in FreeBSD14, use git to download and update the ports collection.

①Install git

When installing from ports

When installing with pkg

➁Port Collection Installation
Check out a copy of the HEAD branch of the ports tree
If there is already a Port Collection, delete it.

Update /usr/ports

➂Installing Ports

Internet connection required to use the Ports Collection
To compile and install a port, go to the directory of the port you want to install and type make at the prompt
To install lsof as an example

During installation, a working subdirectory is created.
Deleting this directory saves disk space.

2.4 Upgrade Ports

①Port upgrade using Portmaster
Find a portmaster

portmaster installation

Search for updates

Bulk update using portmaster
Portmaster creates a backup package before removing an existing port.
If the the new version is successfully installed, portmaster will delete the backup.

Examples of typical options
-b : Portmaster does not automatically delete backups
-i : Start Portmaster in interactive mode and ask for confirmation before upgrading each port

If an error occurs during the upgrade, add -f to upgrade and rebuild all ports

Port upgrade using Portupgrade

Find portupgrade

Install portupgrade

Updating INDEX

Scan the list of installed ports and correct any inconsistencies

Upgrade all old ports installed in the system

When upgrading while asking for confirmation of individual upgrades

Copied title and URL