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.
The OpenSSH server allows password authentication login by default.
If the service is enabled, you can log in remotely.
Confirm validity of sshd service
|
1 2 |
# grep sshd /etc/rc.conf sshd_enable="YES" |
You can now connect via SSH from Tabby Terminal on Windows.
Contents
1. Binary Update
Displaying version information such as kernel version
|
1 2 |
# uname -srm FreeBSD 15.0-RELEASE amd64 |
Get all available binary updates (security updates)
There were no updates this time.
|
1 2 3 4 5 6 7 8 9 10 |
# freebsd-update fetch Looking up update.FreeBSD.org mirrors... 3 mirrors found. Fetching public key from update1.freebsd.org... done. Fetching metadata signature for 15.0-RELEASE from update1.freebsd.org... done. Fetching metadata index... done. Fetching 1 metadata files... done. Inspecting system... done. Preparing to download files... done. No updates needed to update system to 15.0-RELEASE-p0. |
Install updates or upgrades
|
1 2 3 |
# freebsd-update install No updates are available to install. Run 'freebsd-update [options] fetch' first. |
Restart the server to boot from the installed image.
|
1 |
# shutdown -r now |
Check the updated version
|
1 2 |
# uname -srm FreeBSD 15.0-RELEASE amd64 |
|
1 2 3 4 |
# freebsd-version -kur 15.0-RELEASE 15.0-RELEASE 15.0-RELEASE |
2. Pkgng
2.1Initial Configuration for Package System (pkgng)
Update to the latest version.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# pkg update The package management tool is not yet installed on your system. Do you want to fetch and install it now? [y/N]: y Bootstrapping pkg from pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/quarterly, please wait... Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done Installing pkg-2.4.2... Extracting pkg-2.4.2: 100% Updating FreeBSD-ports repository catalogue... Fetching meta.conf: 100% 179 B 0.2kB/s 00:01 Fetching data.pkg: 100% 10 MiB 10.7MB/s 00:01 Processing entries: 100% FreeBSD-ports repository update completed. 36512 packages processed. Updating FreeBSD-ports-kmods repository catalogue... Fetching meta.conf: 100% 179 B 0.2kB/s 00:01 Fetching data.pkg: 100% 31 KiB 31.6kB/s 00:01 Processing entries: 100% FreeBSD-ports-kmods repository update completed. 207 packages processed. All repositories are up to date. |
2.2 How to Use the Pkg Command
1️⃣ Application Search
For example, when searching for MySQL 8
|
1 2 3 4 5 |
# pkg search mysql8 mysql80-client-8.0.43 Multithreaded SQL database (client) mysql80-server-8.0.43 Multithreaded SQL database (server) mysql84-client-8.4.5 Multithreaded SQL database (client) mysql84-server-8.4.5 Multithreaded SQL database (server) |
2️⃣ Install the application
For example, installing curl
|
1 |
# pkg install curl |
3️⃣ Retrieving information about installed packages
|
1 2 3 4 5 6 7 8 9 10 11 12 |
# pkg info brotli-1.1.0,1 Generic-purpose lossless compression algorithm curl-8.16.0 Command line tool and library for transferring data with URLs indexinfo-0.3.1_1 Utility to regenerate the GNU info page index libidn2-2.3.8 Implementation of IDNA2008 internationalized domain names liblz4-1.10.0,1 LZ4 compression library, lossless and very fast libnghttp2-1.67.0 HTTP/2 C Library libpsl-0.21.5_2 C library to handle the Public Suffix List libssh2-1.11.1,3 Library implementing the SSH2 protocol libunistring-1.4.1 Unicode string library pkg-2.4.2 Package manager zstd-1.5.7 Fast real-time compression algorithm |
To retrieve information about the curl you just installed,
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# pkg info curl curl-8.16.0 Name : curl Version : 8.16.0 Installed on : Thu Dec 4 19:02:40 2025 JST Origin : ftp/curl Architecture : FreeBSD:15:amd64 Prefix : /usr/local Categories : ftp net www Licenses : MIT Maintainer : sunpoet@FreeBSD.org WWW : https://curl.se/ Comment : Command line tool and library for transferring data with URLs ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ It supports DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, Telnet and TFTP. curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, HTTP/2, cookies, user+password authentication (Basic, Plain, Digest, CRAM-MD5, NTLM, Negotiate and Kerberos), file transfer resume, proxy tunneling and more. |
4️⃣ Application Removal
|
1 |
# pkg delete [Package Name] |
5️⃣ Application Status
|
1 2 3 4 5 6 7 8 9 10 11 12 |
# pkg info brotli-1.1.0,1 Generic-purpose lossless compression algorithm curl-8.16.0 Command line tool and library for transferring data with URLs indexinfo-0.3.1_1 Utility to regenerate the GNU info page index libidn2-2.3.8 Implementation of IDNA2008 internationalized domain names liblz4-1.10.0,1 LZ4 compression library, lossless and very fast libnghttp2-1.67.0 HTTP/2 C Library libpsl-0.21.5_2 C library to handle the Public Suffix List libssh2-1.11.1,3 Library implementing the SSH2 protocol libunistring-1.4.1 Unicode string library pkg-2.4.2 Package manager zstd-1.5.7 Fast real-time compression algorithm |
6️⃣ Check the application update status
|
1 2 3 4 5 6 7 8 9 10 11 12 |
# pkg version brotli-1.1.0,1 = curl-8.16.0 = indexinfo-0.3.1_1 = libidn2-2.3.8 = liblz4-1.10.0,1 = libnghttp2-1.67.0 = libpsl-0.21.5_2 = libssh2-1.11.1,3 = libunistring-1.4.1 = pkg-2.4.2 = zstd-1.5.7 = |
>: If a newer version than the one currently installed has been released
=: If a version equivalent to the one currently installed has been released
<: If an older version than the one currently installed is released
7️⃣ Updating Packages
|
1 |
# pkg upgrade [Package Name] |
To update all packages
|
1 |
# pkg upgrade |
3 Installing the Ports Collection
1️⃣ Install Git
When installing from ports
|
1 2 |
# cd /usr/ports/devel/git # make install clean |
When installing via pkg
|
1 |
# pkg install git |
2️⃣ Installing Port Collection
Check out a copy of the HEAD branch of the ports tree
If you already have a Port Collection, delete it beforehand
|
1 |
# rm -Rf /usr/ports |
|
1 |
# git clone --depth 1 https://git.FreeBSD.org/ports.git /usr/ports |
Update /usr/ports
|
1 |
# git -C /usr/ports pull |
3️⃣ Perl 5 Upgrade
You will need "perl5 42", so please upgrade.
Copy and edit the configuration file for "make".
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# cp /usr/share/examples/etc/make.conf /etc/make.conf # chmod 644 /etc/make.conf # vi /etc/make.conf If you are not using X11, add the following: OPTIONS_UNSET+=X11 OPTIONS_UNSET+=GUI NO_X=true When installing PHP and using Japanese, add the following: OPTIONS_SET+=MBSTRING When primarily using the Python 3.11 series, write the following: DEFAULT_VERSIONS+=python=3.11 python3=3.11 When primarily using the Ruby 3.2 series, write the following: DEFAULT_VERSIONS+=ruby=3.2 When installing autoconf, "perl5 5.40" is required, so please note this in advance. DEFAULT_VERSIONS+=perl5=5.42 |
|
1 2 3 |
# cd /usr/ports/lang/perl5.42 # make NO_DIALOG=yes # make reinstall |
Since Git has been removed, please reinstall it.
|
1 |
# pkg install git |
4️⃣ Maintenance Tools for Ports
Install the "ports" and "portupgrade" tools for maintaining ports.
|
1 |
# pkg install ports-mgmt/portupgrade |
5️⃣ Before starting the upgrade, read the /usr/ports/UPDATING file to check for important changes or items requiring manual intervention.
|
1 |
# less /usr/ports/UPDATING |
6 .Bulk Upgrade Ports
|
1 |
# portupgrade -aR |
To check upgrades individually, add the -i option.
|
1 |
# portupgrade -aRi |
