aboutsummaryrefslogtreecommitdiff
path: root/documentation/content/en/books/handbook/ports/_index.adoc
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/content/en/books/handbook/ports/_index.adoc')
-rw-r--r--documentation/content/en/books/handbook/ports/_index.adoc791
1 files changed, 377 insertions, 414 deletions
diff --git a/documentation/content/en/books/handbook/ports/_index.adoc b/documentation/content/en/books/handbook/ports/_index.adoc
index cfe881e847..7ef3b47c7d 100644
--- a/documentation/content/en/books/handbook/ports/_index.adoc
+++ b/documentation/content/en/books/handbook/ports/_index.adoc
@@ -7,7 +7,7 @@ description: "FreeBSD provides two complementary technologies for installing thi
tags: ["ports", "collection", "pkg", "poudriere", "management"]
showBookMenu: true
weight: 6
-path: "/books/handbook/"
+path: "/books/handbook/ports/"
---
[[ports]]
@@ -68,15 +68,6 @@ After reading this chapter, you will know:
[[ports-overview]]
== Overview of Software Installation
-The typical steps for installing third-party software on a UNIX(R) system include:
-
-[.procedure]
-. Find and download the software, which might be distributed in source code format or as a binary.
-. Unpack the software from its distribution format. This is typically a tarball compressed with a program such as man:compress[1], man:gzip[1], man:bzip2[1] or man:xz[1].
-. Locate the documentation in [.filename]#INSTALL#, [.filename]#README# or some file in a [.filename]#doc/# subdirectory and read up on how to install the software.
-. If the software was distributed in source format, compile it. This may involve editing a [.filename]#Makefile# or running a `configure` script.
-. Test and install the software.
-
A FreeBSD _port_ is a collection of files designed to automate the process of compiling an application from source code.
The files that comprise a port contain all the necessary information to automatically download, extract, patch, compile, and install the application.
@@ -98,14 +89,14 @@ Select the technology that meets your requirements for installing a particular a
.Package Benefits
* A compressed package tarball is typically smaller than the compressed tarball containing the source code for the application.
-* Packages do not require compilation time. For large applications, such as Mozilla, KDE, or GNOME, this can be important on a slow system.
+* Packages do not require compilation time. For large applications, such as Firefox, KDE Plasma, or GNOME, this can be important on a slow system.
* Packages do not require any understanding of the process involved in compiling software on FreeBSD.
.Port Benefits
* Packages are normally compiled with conservative options because they have to run on the maximum number of systems. By compiling from the port, one can change the compilation options.
-* Some applications have compile-time options relating to which features are installed. For example, Apache can be configured with a wide variety of different built-in options.
+* Some applications have compile-time options relating to which features are installed. For example, NGINX(R) can be configured with a wide variety of different built-in options.
+
-In some cases, multiple packages will exist for the same application to specify certain settings. For example, Ghostscript is available as a [.filename]#ghostscript# package and a [.filename]#ghostscript-nox11# package, depending on whether or not Xorg is installed. Creating multiple packages rapidly becomes impossible if an application has more than one or two different compile-time options.
+In some cases, multiple packages will exist for the same application to specify certain settings. For example, NGINX(R) is available as a `nginx` package and a `nginx-lite` package, depending on whether or not Xorg is installed. Creating multiple packages rapidly becomes impossible if an application has more than one or two different compile-time options.
* The licensing conditions of some software forbid binary distribution. Such software must be distributed as source code which must be compiled by the end-user.
* Some people do not trust binary distributions or prefer to read through source code in order to look for potential problems.
* Source code is needed in order to apply custom patches.
@@ -114,8 +105,9 @@ To keep track of updated ports, subscribe to the {freebsd-ports} and the {freebs
[WARNING]
====
+Before installing an application, check https://vuxml.freebsd.org/[] for related security issues.
-Before installing any application, check https://vuxml.freebsd.org/[] for security issues related to the application or type `pkg audit -F` to check all installed applications for known vulnerabilities.
+To audit installed packages against known vulnerabilities, run `pkg audit -F`.
====
The remainder of this chapter explains how to use packages and ports to install and manage third-party software on FreeBSD.
@@ -126,210 +118,66 @@ The remainder of this chapter explains how to use packages and ports to install
FreeBSD's list of available applications is growing all the time.
There are a number of ways to find software to install:
-* The FreeBSD web site maintains an up-to-date searchable list of all the available applications, at link:https://www.FreeBSD.org/ports/[https://www.FreeBSD.org/ports/]. The ports can be searched by application name or by software category.
-* Dan Langille maintains http://www.FreshPorts.org/[FreshPorts.org] which provides a comprehensive search utility and also tracks changes to the applications in the Ports Collection. Registered users can create a customized watch list in order to receive an automated email when their watched ports are updated.
-* If finding a particular application becomes challenging, try searching a site like http://www.sourceforge.net/[SourceForge.net] or http://www.github.com/[GitHub.com] then check back at the link:https://www.FreeBSD.org/ports/[FreeBSD site] to see if the application has been ported.
-* To search the binary package repository for an application:
-+
-[source,shell]
-....
-# pkg search subversion
-git-subversion-1.9.2
-java-subversion-1.8.8_2
-p5-subversion-1.8.8_2
-py27-hgsubversion-1.6
-py27-subversion-1.8.8_2
-ruby-subversion-1.8.8_2
-subversion-1.8.8_2
-subversion-book-4515
-subversion-static-1.8.8_2
-subversion16-1.6.23_4
-subversion17-1.7.16_2
-....
-+
-Package names include the version number and, in the case of ports based on python, the version number of the version of python the package was built with.
-Some ports also have multiple versions available.
-In the case of Subversion, there are different versions available, as well as different compile options.
-In this case, the statically linked version of Subversion.
-When indicating which package to install, it is best to specify the application by the port origin, which is the path in the ports tree.
-Repeat the `pkg search` with `-o` to list the origin of each package:
-+
-[source,shell]
-....
-# pkg search -o subversion
-devel/git-subversion
-java/java-subversion
-devel/p5-subversion
-devel/py-hgsubversion
-devel/py-subversion
-devel/ruby-subversion
-devel/subversion16
-devel/subversion17
-devel/subversion
-devel/subversion-book
-devel/subversion-static
-....
-+
-Searching by shell globs, regular expressions, exact match, by description, or any other field in the repository database is also supported by `pkg search`.
-After installing package:ports-mgmt/pkg[] or package:ports-mgmt/pkg-devel[], see man:pkg-search[8] for more details.
-* If the Ports Collection is already installed, there are several methods to query the local version of the ports tree. To find out which category a port is in, type `whereis _file_`, where _file_ is the program to be installed:
-+
-[source,shell]
-....
-# whereis lsof
-lsof: /usr/ports/sysutils/lsof
-....
-+
-Alternately, an man:echo[1] statement can be used:
-+
-[source,shell]
-....
-# echo /usr/ports/*/*lsof*
-/usr/ports/sysutils/lsof
-....
-+
-Note that this will also return any matched files downloaded into the [.filename]#/usr/ports/distfiles# directory.
-* Another way to find software is by using the Ports Collection's built-in search mechanism. To use the search feature, cd to [.filename]#/usr/ports# then run `make search name=program-name` where _program-name_ is the name of the software. For example, to search for `lsof`:
-+
-[source,shell]
-....
-# cd /usr/ports
-# make search name=lsof
-Port: lsof-4.88.d,8
-Path: /usr/ports/sysutils/lsof
-Info: Lists information about open files (similar to fstat(1))
-Maint: ler@lerctr.org
-Index: sysutils
-B-deps:
-R-deps:
-....
-+
-[TIP]
-====
-The built-in search mechanism uses a file of index information.
-If a message indicates that the [.filename]#INDEX# is required, run `make fetchindex` to download the current index file.
-With the [.filename]#INDEX# present, `make search` will be able to perform the requested search.
-====
-+
-The "Path:" line indicates where to find the port.
-+
-To receive less information, use the `quicksearch` feature:
-+
-[source,shell]
-....
-# cd /usr/ports
-# make quicksearch name=lsof
-Port: lsof-4.88.d,8
-Path: /usr/ports/sysutils/lsof
-Info: Lists information about open files (similar to fstat(1))
-....
-+
-For more in-depth searching, use `make search key=_string_` or `make quicksearch key=_string_`, where _string_ is some text to search for.
-The text can be in comments, descriptions, or dependencies in order to find ports which relate to a particular subject when the name of the program is unknown.
-+
-When using `search` or `quicksearch`, the search string is case-insensitive.
-Searching for "LSOF" will yield the same results as searching for "lsof".
+* The FreeBSD web site maintains an up-to-date searchable list of all the available applications, at link:https://www.FreeBSD.org/ports/[Ports Portal]. The ports can be searched by application name or by software category.
+* Dan Langille maintains https://www.freshports.org/[FreshPorts] which provides a comprehensive search utility and also tracks changes to the applications in the Ports Collection. Registered users can create a customized watch list in order to receive an automated email when their watched ports are updated.
+* If finding a particular application becomes challenging, try searching a site like https://sourceforge.net/[SourceForge] or https://github.com/[GitHub] then check back at the link:https://www.FreeBSD.org/ports/[Ports Portal] to see if the application has been ported.
+* Search the binary package repository for an application using the man:pkg[8] command
[[pkgng-intro]]
== Using pkg for Binary Package Management
-pkg is the next generation replacement for the traditional FreeBSD package management tools, offering many features that make dealing with binary packages faster and easier.
+man:pkg[8] provides an interface for manipulating packages: registering, adding, removing and upgrading packages.
-For sites wishing to only use prebuilt binary packages from the FreeBSD mirrors, managing packages with pkg can be sufficient.
+For sites wishing to only use prebuilt binary packages from the FreeBSD mirrors, managing packages with man:pkg[8] can be sufficient.
-However, for those sites building from source or using their own repositories, a separate <<ports-upgrading-tools,port management tool>> will be needed.
+However, for those sites building from source a separate <<ports-upgrading-tools, port management tool>> will be needed.
-Since pkg only works with binary packages, it is not a replacement for such tools.
-Those tools can be used to install software from both binary packages and the Ports Collection, while pkg installs only binary packages.
+Since man:pkg[8] only works with binary packages, it is not a replacement for such tools.
+Those tools can be used to install software from both binary packages and the Ports Collection, while man:pkg[8] installs only binary packages.
[[pkgng-initial-setup]]
=== Getting Started with pkg
-FreeBSD includes a bootstrap utility which can be used to download and install pkg and its manual pages.
-This utility is designed to work with versions of FreeBSD starting with 10._X_.
+All supported versions of FreeBSD now contain `/usr/sbin/pkg` a.k.a man:pkg[7].
+This is a small placeholder that has just the minimum functionality required to install the real man:pkg[8].
[NOTE]
====
-Not all FreeBSD versions and architectures support this bootstrap process.
-The current list is at https://pkg.freebsd.org/[].
-For other cases, pkg must instead be installed from the Ports Collection or as a binary package.
+An Internet working connection is required for the bootstrap process to succeed.
====
-To bootstrap the system, run:
+Run man:pkg[8] command line:
[source,shell]
....
-# /usr/sbin/pkg
+# pkg
....
-You must have a working Internet connection for the bootstrap process to succeed.
-
-Otherwise, to install the port, run:
-
-[source,shell]
-....
-# cd /usr/ports/ports-mgmt/pkg
-# make
-# make install clean
-....
-
-When upgrading an existing system that originally used the older pkg_* tools,
-the database must be converted to the new format, so that the new tools are aware of the already installed packages.
-Once pkg has been installed, the package database must be converted from the traditional format to the new format by running this command:
-
-[source,shell]
-....
-# pkg2ng
-....
-
-[NOTE]
-====
-This step is not required for new installations that do not yet have any third-party software installed.
-====
-
-[IMPORTANT]
-====
-This step is not reversible.
-Once the package database has been converted to the pkg format, the traditional `pkg_*` tools should no longer be used.
-====
-
-[NOTE]
-====
-The package database conversion may emit errors as the contents are converted to the new version.
-Generally, these errors can be safely ignored.
-However, a list of software that was not successfully converted is shown after `pkg2ng` finishes.
-These applications must be manually reinstalled.
-====
-
-To ensure that the Ports Collection registers new software with pkg instead of the traditional packages database,
-FreeBSD versions earlier than 10._X_ require this line in [.filename]#/etc/make.conf#:
+The output should be similar to the following:
[.programlisting]
....
-WITH_PKGNG= yes
+The package management tool is not yet installed on your system.
+Do you want to fetch and install it now? [y/N]
....
-By default, pkg uses the binary packages from the FreeBSD package mirrors (the _repository_).
-For information about building a custom package repository, see <<ports-poudriere>>.
+man:pkg[7] will intercept the command, and if you confirm that is your intention, download the man:pkg[8] tarball, install man:pkg[8] from it, bootstrap the local package database and then proceed to run the command you originally requested.
-Additional pkg configuration options are described in man:pkg.conf[5].
+More recent versions of man:pkg[7] understand `pkg -N` as a test to see if man:pkg[8] is installed without triggering the installation, and conversely, pkg bootstrap[-f] to install man:pkg[8] (or force it to be reinstalled) without performing any other actions.
Usage information for pkg is available in the man:pkg[8] manual page or by running `pkg` without additional arguments.
+Additional pkg configuration options are described in man:pkg.conf[5].
Each pkg command argument is documented in a command-specific manual page.
-To read the manual page for `pkg install`, for example, run either of these commands:
-[source,shell]
-....
-# pkg help install
-....
+To read the manual page for `pkg install`, for example, run this command:
[source,shell]
....
-# man pkg-install
+# pkg help install
....
-The rest of this section demonstrates common binary package management tasks which can be performed using pkg.
+The rest of this section demonstrates common binary package management tasks which can be performed using man:pkg[8].
Each demonstrated command provides many switches to customize its use.
Refer to a command's help or man page for details and more examples.
@@ -341,89 +189,113 @@ This is done essentially by only allowing non-feature updates.
Quarterly branches aim to receive security fixes (that may be version updates, or backports of commits), bug fixes and ports compliance or framework changes.
The Quarterly branch is cut from HEAD at the beginning of every (yearly) quarter in January, April, July, and October.
Branches are named according to the year (YYYY) and quarter (Q1-4) they are created in.
-For example, the quarterly branch created in January 2016, is named 2016Q1.
+For example, the quarterly branch created in January 2023, is named 2023Q1.
And the `Latest` branch provides the latest versions of the packages to the users.
-To switch from quarterly to latest run the following commands:
+To switch man:pkg[8] from Quarterly to Latest run the following commands:
[source,shell]
....
# mkdir -p /usr/local/etc/pkg/repos
-# cp /etc/pkg/FreeBSD.conf /usr/local/etc/pkg/repos/FreeBSD.conf
-....
-
-Edit the file [.filename]#/usr/local/etc/pkg/repos/FreeBSD.conf# and change the string _quarterly_ to _latest_ in the `url:` line.
-
-The result should be similar to the following:
-
-[.programlisting]
-....
-FreeBSD: {
- url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
- mirror_type: "srv",
- signature_type: "fingerprints",
- fingerprints: "/usr/share/keys/pkg",
- enabled: yes
-}
+# echo 'FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest" }' > /usr/local/etc/pkg/repos/FreeBSD.conf
....
-And finally run this command to update from the new (latest) repository metadata.
+Then run this command to update the local package repositories catalogues for the Latest branch:
[source,shell]
....
# pkg update -f
....
-[[pkgng-pkg-info]]
-=== Obtaining Information About Installed Packages
+[[pkg-configuration]]
+=== Configure pkg
-Information about the packages installed on a system can be viewed by running `pkg info` which, when run without any switches,
-will list the package version for either all installed packages or the specified package.
+man:pkg.conf[5] is the system-wide configuration file used by the man:pkg[8] tools.
+The default location of this file is `/usr/local/etc/pkg.conf`.
-For example, to see which version of pkg is installed, run:
+[NOTE]
+====
+FreeBSD does not need to have a `pkg.conf` file.
+Many installations will work well with no `pkg.conf` at all or with an empty `pkg.conf` (other than comment lines).
+====
-[source,shell]
-....
-# pkg info pkg
-pkg-1.1.4_1
-....
+Lines in the file beginning with a "#" are comments and are ignored.
+
+The file is in UCL format.
+For more information on the syntax of man:libucl[3], please visit the link:https://github.com/vstakhov/libucl[official UCL website].
+
+The following types of options are recognized - boolean, string and list options.
-[[pkgng-installing-deinstalling]]
-=== Installing and Removing Packages
+A boolean option is marked as enabled if one of the following values is specified in the configuration file - YES, TRUE and ON.
-To install a binary package use the following command, where _packagename_ is the name of the package to install:
+[[pkg-search]]
+=== Searching Packages
+
+To search a package man:pkg-search[8] can be used:
[source,shell]
....
-# pkg install packagename
+# pkg search nginx
....
+The output should be similar to the following:
+
+[.programlisting]
+....
+modsecurity3-nginx-1.0.3 Instruction detection and prevention engine / nginx Wrapper
+nginx-1.22.1_2,3 Robust and small WWW server
+nginx-devel-1.23.2_4 Robust and small WWW server
+nginx-full-1.22.1_1,3 Robust and small WWW server (full package)
+nginx-lite-1.22.1,3 Robust and small WWW server (lite package)
+nginx-naxsi-1.22.1,3 Robust and small WWW server (plus NAXSI)
+nginx-prometheus-exporter-0.10.0_7 Prometheus exporter for NGINX and NGINX Plus stats
+nginx-ultimate-bad-bot-blocker-4.2020.03.2005_1 Nginx bad bot and other things blocker
+nginx-vts-exporter-0.10.7_7 Server that scraps NGINX vts stats and export them via HTTP
+p5-Nginx-ReadBody-0.07_1 Nginx embeded perl module to read and evaluate a request body
+p5-Nginx-Simple-0.07_1 Perl 5 module for easy to use interface for Nginx Perl Module
+p5-Test-Nginx-0.30 Testing modules for Nginx C module development
+py39-certbot-nginx-2.0.0 NGINX plugin for Certbot
+rubygem-passenger-nginx-6.0.15 Modules for running Ruby on Rails and Rack applications
+....
+
+[[pkg-installing-fetching]]
+=== Installing and Fetching Packages
+
+To install a binary package man:pkg-install[8] can be used.
This command uses repository data to determine which version of the software to install and if it has any uninstalled dependencies.
For example, to install curl:
[source,shell]
....
# pkg install curl
-Updating repository catalogue
-/usr/local/tmp/All/curl-7.31.0_1.txz 100% of 1181 kB 1380 kBps 00m01s
+....
-/usr/local/tmp/All/ca_root_nss-3.15.1_1.txz 100% of 288 kB 1700 kBps 00m00s
+The output should be similar to the following:
-Updating repository catalogue
-The following 2 packages will be installed:
+[.programlisting]
+....
+Updating FreeBSD repository catalogue...
+FreeBSD repository is up to date.
+All repositories are up to date.
+The following 9 package(s) will be affected (of 0 checked):
- Installing ca_root_nss: 3.15.1_1
- Installing curl: 7.31.0_1
+New packages to be INSTALLED:
+ ca_root_nss: 3.83
+ curl: 7.86.0
+ gettext-runtime: 0.21
+ indexinfo: 0.3.1
+ libidn2: 2.3.3
+ libnghttp2: 1.48.0
+ libpsl: 0.21.1_4
+ libssh2: 1.10.0.3
+ libunistring: 1.0
-The installation will require 3 MB more space
+Number of packages to be installed: 9
-0 B to be downloaded
+The process will require 11 MiB more space.
+3 MiB to be downloaded
-Proceed with installing packages [y/N]: y
-Checking integrity... done
-[1/2] Installing ca_root_nss-3.15.1_1... done
-[2/2] Installing curl-7.31.0_1... done
-Cleaning up cache files...Done
+Proceed with this action? [y/N]
....
The new package and any additional packages that were installed as dependencies can be seen in the installed packages list:
@@ -431,31 +303,115 @@ The new package and any additional packages that were installed as dependencies
[source,shell]
....
# pkg info
-ca_root_nss-3.15.1_1 The root certificate bundle from the Mozilla Project
-curl-7.31.0_1 Non-interactive tool to get files from FTP, GOPHER, HTTP(S) servers
-pkg-1.1.4_6 New generation package manager
....
-Packages that are no longer needed can be removed with `pkg delete`.
-For example:
+The output should be similar to the following:
+
+[.programlisting]
+....
+ca_root_nss-3.83 Root certificate bundle from the Mozilla Project
+curl-7.86.0 Command line tool and library for transferring data with URLs
+gettext-runtime-0.21.1 GNU gettext runtime libraries and programs
+indexinfo-0.3.1 Utility to regenerate the GNU info page index
+libidn2-2.3.3 Implementation of IDNA2008 internationalized domain names
+libnghttp2-1.48.0 HTTP/2.0 C Library
+libpsl-0.21.1_6 C library to handle the Public Suffix List
+libssh2-1.10.0.3 Library implementing the SSH2 protocol
+libunistring-1.0 Unicode string library
+pkg-1.18.4 Package manager
+....
+
+To fetch a package and install it later or in another place use man:pkg-fetch[8].
+For example, to download `nginx-lite`:
[source,shell]
....
-# pkg delete curl
-The following packages will be deleted:
+# pkg fetch -d -o /usr/home/user/packages/ nginx-lite
+....
+
+* `-d`: used to fetch all the dependencies
+* `-o`: used to specify the download directory
+
+The output should be similar to the following:
+
+[.programlisting]
+....
+Updating FreeBSD repository catalogue...
+FreeBSD repository is up to date.
+All repositories are up to date.
+The following packages will be fetched:
+
+New packages to be FETCHED:
+ nginx-lite: 1.22.1,3 (342 KiB: 22.20% of the 2 MiB to download)
+ pcre: 8.45_3 (1 MiB: 77.80% of the 2 MiB to download)
+
+Number of packages to be fetched: 2
+
+The process will require 2 MiB more space.
+2 MiB to be downloaded.
+
+Proceed with fetching packages? [y/N]:
+....
+
+To install the downloaded packages man:pkg-install[8] can be used as follows:
+
+[source,shell]
+....
+# cd /usr/home/user/packages/
+....
+
+[source,shell]
+....
+# pkg install nginx-lite-1.22.1,3.pkg
+....
- curl-7.31.0_1
+[[pkgng-pkg-info]]
+=== Obtaining Information About Installed Packages
+
+Information about the packages installed on a system can be viewed by running man:pkg-info[8] which, when run without any switches, will list the package version for either all installed packages or the specified package.
+
+For example, to see which version of pkg is installed, run:
+
+[source,shell]
+....
+# pkg info pkg
+....
-The deletion will free 3 MB
+The output should be similar to the following:
-Proceed with deleting packages [y/N]: y
-[1/1] Deleting curl-7.31.0_1... done
+[.programlisting]
+....
+pkg-1.19.0
+Name : pkg
+Version : 1.19.0
+Installed on : Sat Dec 17 11:05:28 2022 CET
+Origin : ports-mgmt/pkg
+Architecture : FreeBSD:13:amd64
+Prefix : /usr/local
+Categories : ports-mgmt
+Licenses : BSD2CLAUSE
+Maintainer : pkg@FreeBSD.org
+WWW : https://github.com/freebsd/pkg
+Comment : Package manager
+Options :
+ DOCS : on
+Shared Libs provided:
+ libpkg.so.4
+Annotations :
+ FreeBSD_version: 1301000
+ repo_type : binary
+ repository : FreeBSD
+Flat size : 33.2MiB
+Description :
+Package management tool
+
+WWW: https://github.com/freebsd/pkg
....
[[pkgng-upgrading]]
=== Upgrading Installed Packages
-Installed packages can be upgraded to their latest versions by running:
+Installed packages can be upgraded to their latest versions using man:pkg-upgrade[8]:
[source,shell]
....
@@ -469,49 +425,117 @@ This command will compare the installed versions with those available in the rep
Software vulnerabilities are regularly discovered in third-party applications.
To address this, pkg includes a built-in auditing mechanism.
-To determine if there are any known vulnerabilities for the software installed on the system, run:
+To determine if there are any known vulnerabilities for the software installed on the system, use man:pkg-audit[8]:
[source,shell]
....
# pkg audit -F
....
+The output should be similar to the following:
+
+[.programlisting]
+....
+Fetching vuln.xml.xz: 100% 976 KiB 499.5kB/s 00:02
+chromium-108.0.5359.98 is vulnerable:
+ chromium -- multiple vulnerabilities
+ CVE: CVE-2022-4440
+ CVE: CVE-2022-4439
+ CVE: CVE-2022-4438
+ CVE: CVE-2022-4437
+ CVE: CVE-2022-4436
+ WWW: https://vuxml.FreeBSD.org/freebsd/83eb9374-7b97-11ed-be8f-3065ec8fd3ec.html
+....
+
+[[pkg-delete]]
+=== Removing Packages
+
+Packages that are no longer needed can be removed with man:pkg-delete[8].
+
+For example:
+
+[source,shell]
+....
+# pkg delete curl
+....
+
+The output should be similar to the following:
+
+[.programlisting]
+....
+Checking integrity... done (0 conflicting)
+Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):
+
+Installed packages to be REMOVED:
+ curl :7.86.0
+
+Number of packages to be removed: 1
+
+The operation will free 4 MiB.
+
+Proceed with deinstallation packages? [y/N]: y
+[1/1] Deinstalling curl-7.86.0...
+[1/1] Deleting files for curl-7.86.0: 100%
+....
+
[[pkgng-autoremove]]
=== Automatically Removing Unused Packages
Removing a package may leave behind dependencies which are no longer required.
-Unneeded packages that were installed as dependencies (leaf packages) can be automatically detected and removed using:
+Unneeded packages that were installed as dependencies (leaf packages) can be automatically detected and removed using man:pkg-autoremove[8]:
[source,shell]
....
# pkg autoremove
-Packages to be autoremoved:
- ca_root_nss-3.15.1_1
+....
+
+The output should be similar to the following:
+
+[.programlisting]
+....
+Checking integrity... done (0 conflicting)
+Deinstallation has been requested for the following 1 packages:
+
+Installed packages to be REMOVED:
+ ca_root_nss-3.83
+
+Number of packages to be removed: 1
-The autoremoval will free 723 kB
+The operation will free 723 KiB.
-Proceed with autoremoval of packages [y/N]: y
-Deinstalling ca_root_nss-3.15.1_1... done
+Proceed with deinstalling packages? [y/N]:
....
Packages installed as dependencies are called _automatic_ packages.
-Non-automatic packages, i.e the packages that were explicity installed not as a dependency to another package, can be listed using:
+Non-automatic packages, i.e the packages that were explicitly installed not as a dependency to another package, can be listed using:
[source,shell]
....
# pkg prime-list
+....
+
+The output should be similar to the following:
+
+[.programlisting]
+....
nginx
openvpn
sudo
....
-`pkg prime-list` is an alias command declared in [.filename]#/usr/local/etc/pkg.conf#.
+`pkg prime-list` is an alias command declared in `/usr/local/etc/pkg.conf`.
There are many others that can be used to query the package database of the system.
For instance, command `pkg prime-origins` can be used to get the origin port directory of the list mentioned above:
[source,shell]
....
# pkg prime-origins
+....
+
+The output should be similar to the following:
+
+[.programlisting]
+....
www/nginx
security/openvpn
security/sudo
@@ -535,55 +559,45 @@ Marking an installed package as _not_ automatic can be done using:
# pkg set -A 0 devel/cmake
....
-[[pkgng-backup]]
-=== Restoring the Package Database
-
-Unlike the traditional package management system, pkg includes its own package database backup mechanism.
-This functionality is enabled by default.
-
-[TIP]
-====
-To disable the periodic script from backing up the package database, set `daily_backup_pkgdb_enable="NO"` in man:periodic.conf[5].
-====
+[[pkgng-clean]]
+=== Removing Stale Packages
-To restore the contents of a previous package database backup,
-run the following command replacing _/path/to/pkg.sql_ with the location of the backup:
+By default, pkg stores binary packages in a cache directory defined by `PKG_CACHEDIR` in man:pkg.conf[5].
+Only copies of the latest installed packages are kept. Older versions of pkg kept all previous packages.
+To remove these outdated binary packages, run:
[source,shell]
....
-# pkg backup -r /path/to/pkg.sql
+# pkg clean
....
-[NOTE]
-====
-If restoring a backup taken by the periodic script, it must be decompressed prior to being restored.
-====
-
-To run a manual backup of the pkg database, run the following command,
-replacing _/path/to/pkg.sql_ with a suitable file name and location:
+The entire cache may be cleared by running:
[source,shell]
....
-# pkg backup -d /path/to/pkg.sql
+# pkg clean -a
....
-[[pkgng-clean]]
-=== Removing Stale Packages
+[[pkg-locking-unlocking]]
+=== Locking and Unlocking Packages
-By default, pkg stores binary packages in a cache directory defined by `PKG_CACHEDIR` in man:pkg.conf[5].
-Only copies of the latest installed packages are kept. Older versions of pkg kept all previous packages.
-To remove these outdated binary packages, run:
+man:pkg-lock[8] is used to lock packages against reinstallation, modification or deletion.
+man:pkg-unlock[8] unlocks the named packages.
+Either variant only has an effect on currently installed packages.
+Consequently it is impossible to block installation of a new package by using this mechanism, unless such an installation implies updating a locked package.
+
+For example, to lock `nginx-lite`:
[source,shell]
....
-# pkg clean
+# pkg lock nginx-lite
....
-The entire cache may be cleared by running:
+And to unlock `nginx-lite`:
[source,shell]
....
-# pkg clean -a
+# pkg unlock nginx-lite
....
[[pkgng-set]]
@@ -591,27 +605,20 @@ The entire cache may be cleared by running:
Software within the FreeBSD Ports Collection can undergo major version number changes.
To address this, pkg has a built-in command to update package origins.
-This can be useful, for example, if package:lang/php5[] is renamed to package:lang/php53[] so that package:lang/php5[] can now represent version `5.4`.
+This can be useful, for example, if package:lang/python3[] is renamed to package:lang/python311[] so that package:lang/python3[] can now represent version `3.11`.
To change the package origin for the above example, run:
[source,shell]
....
-# pkg set -o lang/php5:lang/php53
-....
-
-As another example, to update package:lang/ruby18[] to package:lang/ruby19[], run:
-
-[source,shell]
-....
-# pkg set -o lang/ruby18:lang/ruby19
+# pkg set -o lang/python3:lang/python311
....
-As a final example, to change the origin of the [.filename]#libglut# shared libraries from package:graphics/libglut[] to package:graphics/freeglut[], run:
+As another example, to update package:lang/ruby31[] to package:lang/ruby32[], run:
[source,shell]
....
-# pkg set -o graphics/libglut:graphics/freeglut
+# pkg set -o lang/ruby31:lang/ruby32
....
[NOTE]
@@ -621,18 +628,17 @@ To force a reinstallation of dependent packages, run:
[source,shell]
....
-# pkg install -Rf graphics/freeglut
+# pkg install -Rf lang/ruby32
....
-
====
[[ports-using]]
== Using the Ports Collection
-The Ports Collection is a set of [.filename]##Makefile##s, patches, and description files.
+The Ports Collection is a set of `Makefiles`, patches, and description files.
Each set of these files is used to compile and install an individual application on FreeBSD, and is called a _port_.
-By default, the Ports Collection itself is stored as a subdirectory of [.filename]#/usr/ports#.
+By default, the Ports Collection itself is stored as a subdirectory of `/usr/ports`.
[WARNING]
====
@@ -647,17 +653,17 @@ Inside each category are subdirectories for individual applications.
Each application subdirectory contains a set of files that tells FreeBSD how to compile and install that program, called a _ports skeleton_.
Each port skeleton includes these files and directories:
-* [.filename]#Makefile#: contains statements that specify how the application should be compiled and where its components should be installed.
-* [.filename]#distinfo#: contains the names and checksums of the files that must be downloaded to build the port.
-* [.filename]#files/#: this directory contains any patches needed for the program to compile and install on FreeBSD. This directory may also contain other files used to build the port.
-* [.filename]#pkg-descr#: provides a more detailed description of the program.
-* [.filename]#pkg-plist#: a list of all the files that will be installed by the port. It also tells the ports system which files to remove upon deinstallation.
+* *Makefile*: contains statements that specify how the application should be compiled and where its components should be installed.
+* *distinfo*: contains the names and checksums of the files that must be downloaded to build the port.
+* *files/*: this directory contains any patches needed for the program to compile and install on FreeBSD. This directory may also contain other files used to build the port.
+* *pkg-descr*: provides a more detailed description of the program.
+* *pkg-plist*: a list of all the files that will be installed by the port. It also tells the ports system which files to remove upon deinstallation.
-Some ports include [.filename]#pkg-message# or other files to handle special situations.
+Some ports include `pkg-message` or other files to handle special situations.
For more details on these files, and on ports in general, refer to the extref:{porters-handbook}[FreeBSD Porter's Handbook].
-The port does not include the actual source code, also known as a [.filename]#distfile#.
-The extract portion of building a port will automatically save the downloaded source to [.filename]#/usr/ports/distfiles#.
+The port does not include the actual source code, also known as a `distfile`.
+The extract portion of building a port will automatically save the downloaded source to `/usr/ports/distfiles`.
[[ports-using-installation-methods]]
=== Installing the Ports Collection
@@ -665,53 +671,6 @@ The extract portion of building a port will automatically save the downloaded so
Before an application can be compiled using a port, the Ports Collection must first be installed.
If it was not installed during the installation of FreeBSD, use one of the following methods to install it:
-[[ports-using-portsnap-method]]
-[.procedure]
-****
-*Procedure: Portsnap Method*
-
-The base system of FreeBSD includes Portsnap.
-This is a fast and user-friendly tool for retrieving the Ports Collection and is the recommended choice for most users not running FreeBSD-CURRENT.
-This utility connects to a FreeBSD site, verifies the secure key, and downloads a new copy of the Ports Collection.
-The key is used to verify the integrity of all downloaded files.
-
-Note that Portsnap updates are generated from a snapshot of the main
-branch of the Ports Collection and cannot be configured to use a
-different branch (for example, `quarterly`).
-If it is necessary to use a different branch of the Ports Collection
-(for instance as referenced earlier in conjunction with binary
-packages), then the <<ports-using-git-method,Git method>> must be used.
-
-. To download a compressed snapshot of the Ports Collection into [.filename]#/var/db/portsnap#:
-+
-[source,shell]
-....
-# portsnap fetch
-....
-+
-. When running Portsnap for the first time, extract the snapshot into [.filename]#/usr/ports#:
-+
-[source,shell]
-....
-# portsnap extract
-....
-+
-. After the first use of Portsnap has been completed as shown above, [.filename]#/usr/ports# can be updated as needed by running:
-+
-[source,shell]
-....
-# portsnap fetch
-# portsnap update
-....
-+
-When using `fetch`, the `extract` or the `update` operation may be run consecutively, like so:
-+
-[source,shell]
-....
-# portsnap fetch update
-....
-****
-
[[ports-using-git-method]]
[.procedure]
****
@@ -747,21 +706,21 @@ If the ports tree is not available, or pkg is being used to manage packages, Git
+
[source,shell]
....
-# git clone https://git.FreeBSD.org/ports.git -b 2020Q3 /usr/ports
+# git clone https://git.FreeBSD.org/ports.git -b 2023Q1 /usr/ports
....
+
-. As needed, update [.filename]#/usr/ports# after the initial Git checkout:
+. As needed, update `/usr/ports` after the initial Git checkout:
+
[source,shell]
....
# git -C /usr/ports pull
....
+
-. As needed, switch [.filename]#/usr/ports# to a different quarterly branch:
+. As needed, switch `/usr/ports` to a different quarterly branch:
+
[source,shell]
....
-# git -C /usr/ports switch 2020Q4
+# git -C /usr/ports switch 2023Q1
....
****
@@ -775,7 +734,7 @@ The detailed description of available `make` targets and environment variables i
Before compiling any port, be sure to update the Ports Collection as described in the previous section.
Since the installation of any third-party software can introduce security vulnerabilities, it is recommended to first check https://vuxml.freebsd.org/[] for known security issues related to the port.
-Alternately, run `pkg audit -F` before installing a new port.
+Alternatively, run `pkg audit -F` before installing a new port.
This command can be configured to automatically perform a security audit and an update of the vulnerability database during the daily security system check. For more information, refer to man:pkg-audit[8] and man:periodic[8].
====
@@ -847,7 +806,7 @@ To save this extra step, instead use `make install clean` when compiling the por
==== Customizing Ports Installation
Some ports provide build options which can be used to enable or disable application components, provide security options, or allow for other customizations.
-Examples include package:www/firefox[], package:security/gpgme[], and package:mail/sylpheed-claws[].
+Examples include package:www/firefox[] and package:security/gpgme[].
If the port depends upon other ports which have configurable options,
it may pause several times for user interaction as the default behavior is to prompt the user to select options from a menu.
To avoid this and do all of the configuration in one batch, run `make config-recursive` within the port skeleton.
@@ -870,12 +829,12 @@ The ports system uses man:fetch[1] to download the source files, which supports
The `FTP_PASSIVE_MODE`, `FTP_PROXY`, and `FTP_PASSWORD` variables may need to be set if the FreeBSD system is behind a firewall or FTP/HTTP proxy.
See man:fetch[3] for the complete list of supported variables.
-For users who cannot be connected to the Internet all the time, `make fetch` can be run within [.filename]#/usr/ports#,
-to fetch all distfiles, or within a category, such as [.filename]#/usr/ports/net#, or within the specific port skeleton.
+For users who cannot be connected to the Internet all the time, `make fetch` can be run within `/usr/ports`,
+to fetch all distfiles, or within a category, such as `/usr/ports/net`, or within the specific port skeleton.
Note that if a port has any dependencies, running this command in a category or ports skeleton will _not_ fetch the distfiles of ports from another category.
Instead, use `make fetch-recursive` to also fetch the distfiles for all the dependencies of a port.
-In rare cases, such as when an organization has a local distfiles repository, the `MASTER_SITES` variable can be used to override the download locations specified in the [.filename]#Makefile#.
+In rare cases, such as when an organization has a local distfiles repository, the `MASTER_SITES` variable can be used to override the download locations specified in the `Makefile`.
When using, specify the alternate location:
[source,shell]
@@ -892,14 +851,14 @@ The `WRKDIRPREFIX` and `PREFIX` variables can override the default working and t
# make WRKDIRPREFIX=/usr/home/example/ports install
....
-will compile the port in [.filename]#/usr/home/example/ports# and install everything under [.filename]#/usr/local#.
+will compile the port in `/usr/home/example/ports` and install everything under `/usr/local`.
[source,shell]
....
# make PREFIX=/usr/home/example/local install
....
-will compile the port in [.filename]#/usr/ports# and install it in [.filename]#/usr/home/example/local#. And:
+will compile the port in `/usr/ports` and install it in `/usr/home/example/local`. And:
[source,shell]
....
@@ -917,7 +876,7 @@ Refer to the manual page for your shell for instructions on how to set an enviro
Installed ports can be uninstalled using `pkg delete`.
Examples for using this command can be found in the man:pkg-delete[8] manual page.
-Alternately, `make deinstall` can be run in the port's directory:
+Alternately, `make deinstall` can be run in the port\'s directory:
[source,shell]
....
@@ -944,24 +903,17 @@ Over time, newer versions of software become available in the Ports Collection.
This section describes how to determine which software can be upgraded and how to perform the upgrade.
To determine if newer versions of installed ports are available, ensure that the latest version of the ports tree is installed,
-using the updating command described in either <<ports-using-portsnap-method, “Portsnap Method”>> or <<ports-using-git-method, “Git Method”>>.
-On FreeBSD 10 and later, or if the system has been converted to pkg, the following command will list the installed ports which are out of date:
+using the updating command described in <<ports-using-git-method, "Git Method">>.
+The following command will list the installed ports which are out of date:
[source,shell]
....
# pkg version -l "<"
....
-For FreeBSD 9._X_ and lower, the following command will list the installed ports that are out of date:
-
-[source,shell]
-....
-# pkg_version -l "<"
-....
-
[IMPORTANT]
====
-Before attempting an upgrade, read [.filename]#/usr/ports/UPDATING# from the top of the file to the date closest to the last time ports were upgraded or the system was installed.
+Before attempting an upgrade, read `/usr/ports/UPDATING` from the top of the file to the date closest to the last time ports were upgraded or the system was installed.
This file describes various issues and additional steps users may encounter and need to perform when updating a port, including such things as file format changes, changes in locations of configuration files, or any incompatibilities with previous versions.
Make note of any instructions which match any of the ports that need upgrading and follow these instructions when performing the upgrade.
====
@@ -1060,7 +1012,7 @@ To use this function, specify the location of the port in the Ports Collection:
# portmaster shells/bash
....
-More information about package:ports-mgmt/portmaster[] may be found in its [.filename]#pkg-descr#.
+More information about package:ports-mgmt/portmaster[] may be found in its `pkg-descr`.
[[portupgrade]]
==== Upgrading Ports Using Portupgrade
@@ -1107,22 +1059,22 @@ This last set of options tells Portupgrade to abort if no packages are available
To just fetch the port distfiles, or packages, if `-P` is specified, without building or installing anything, use `-F`.
For further information on all of the available switches, refer to the manual page for `portupgrade`.
-More information about package:ports-mgmt/portupgrade[] may be found in its [.filename]#pkg-descr#.
+More information about package:ports-mgmt/portupgrade[] may be found in its `pkg-descr`.
[[ports-disk-space]]
=== Ports and Disk Space
Using the Ports Collection will use up disk space over time.
-After building and installing a port, running `make clean` within the ports skeleton will clean up the temporary [.filename]#work# directory.
+After building and installing a port, running `make clean` within the ports skeleton will clean up the temporary `work` directory.
If Portmaster is used to install a port, it will automatically remove this directory unless `-K` is specified.
-If Portupgrade is installed, this command will remove all [.filename]#work# directories found within the local copy of the Ports Collection:
+If Portupgrade is installed, this command will remove all `work` directories found within the local copy of the Ports Collection:
[source,shell]
....
# portsclean -C
....
-In addition, outdated source distribution files accumulate in [.filename]#/usr/ports/distfiles# over time.
+In addition, outdated source distribution files accumulate in `/usr/ports/distfiles` over time.
To use Portupgrade to delete all the distfiles that are no longer referenced by any ports:
[source,shell]
@@ -1149,23 +1101,23 @@ By default, this command is interactive and prompts the user to confirm if a dis
In addition to these commands, package:ports-mgmt/pkg_cutleaves[] automates the task of removing installed ports that are no longer needed.
[[ports-poudriere]]
-== Building Packages with Poudriere
+== Building Packages with poudriere
-Poudriere is a `BSD`-licensed utility for creating and testing FreeBSD packages.
+poudriere is a `BSD`-licensed utility for creating and testing FreeBSD packages.
It uses FreeBSD jails to set up isolated compilation environments.
These jails can be used to build packages for versions of FreeBSD that are different from the system on which it is installed, and also to build packages for i386 if the host is an amd64 system.
Once the packages are built, they are in a layout identical to the official mirrors.
These packages are usable by man:pkg[8] and other package management tools.
-Poudriere is installed using the package:ports-mgmt/poudriere[] package or port.
-The installation includes a sample configuration file [.filename]#/usr/local/etc/poudriere.conf.sample#.
-Copy this file to [.filename]#/usr/local/etc/poudriere.conf#.
+poudriere is installed using the package:ports-mgmt/poudriere[] package or port.
+The installation includes a sample configuration file `/usr/local/etc/poudriere.conf.sample`.
+Copy this file to `/usr/local/etc/poudriere.conf`.
Edit the copied file to suit the local configuration.
While `ZFS` is not required on the system running poudriere, it is beneficial.
-When `ZFS` is used, `ZPOOL` must be specified in [.filename]#/usr/local/etc/poudriere.conf# and `FREEBSD_HOST` should be set to a nearby mirror.
+When `ZFS` is used, `ZPOOL` must be specified in `/usr/local/etc/poudriere.conf` and `FREEBSD_HOST` should be set to a nearby mirror.
Defining `CCACHE_DIR` enables the use of package:devel/ccache[] to cache compilation and reduce build times for frequently-compiled code.
-It may be convenient to put poudriere datasets in an isolated tree mounted at [.filename]#/poudriere#.
+It may be convenient to put poudriere datasets in an isolated tree mounted at `/poudriere`.
Defaults for the other configuration values are adequate.
The number of processor cores detected is used to define how many builds will run in parallel.
@@ -1182,25 +1134,25 @@ The default is the architecture shown by `uname`.
[source,shell]
....
-# poudriere jail -c -j 11amd64 -v 11.4-RELEASE
-[00:00:00] Creating 11amd64 fs at /poudriere/jails/11amd64... done
-[00:00:00] Using pre-distributed MANIFEST for FreeBSD 11.4-RELEASE amd64
-[00:00:00] Fetching base for FreeBSD 11.4-RELEASE amd64
-/poudriere/jails/11amd64/fromftp/base.txz 125 MB 4110 kBps 31s
+# poudriere jail -c -j 13amd64 -v 13.1-RELEASE
+[00:00:00] Creating 13amd64 fs at /poudriere/jails/13amd64... done
+[00:00:00] Using pre-distributed MANIFEST for FreeBSD 13.1-RELEASE amd64
+[00:00:00] Fetching base for FreeBSD 13.1-RELEASE amd64
+/poudriere/jails/13amd64/fromftp/base.txz 125 MB 4110 kBps 31s
[00:00:33] Extracting base... done
-[00:00:54] Fetching src for FreeBSD 11.4-RELEASE amd64
-/poudriere/jails/11amd64/fromftp/src.txz 154 MB 4178 kBps 38s
+[00:00:54] Fetching src for FreeBSD 13.1-RELEASE amd64
+/poudriere/jails/13amd64/fromftp/src.txz 154 MB 4178 kBps 38s
[00:01:33] Extracting src... done
-[00:02:31] Fetching lib32 for FreeBSD 11.4-RELEASE amd64
-/poudriere/jails/11amd64/fromftp/lib32.txz 24 MB 3969 kBps 06s
+[00:02:31] Fetching lib32 for FreeBSD 13.1-RELEASE amd64
+/poudriere/jails/13amd64/fromftp/lib32.txz 24 MB 3969 kBps 06s
[00:02:38] Extracting lib32... done
[00:02:42] Cleaning up... done
[00:02:42] Recording filesystem state for clean... done
[00:02:42] Upgrading using ftp
-/etc/resolv.conf -> /poudriere/jails/11amd64/etc/resolv.conf
+/etc/resolv.conf -> /poudriere/jails/13amd64/etc/resolv.conf
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching public key from update4.freebsd.org... done.
-Fetching metadata signature for 11.4-RELEASE from update4.freebsd.org... done.
+Fetching metadata signature for 13.1-RELEASE from update4.freebsd.org... done.
Fetching metadata index... done.
Fetching 2 metadata files... done.
Inspecting system... done.
@@ -1209,7 +1161,7 @@ Fetching 124 patches.....10....20....30....40....50....60....70....80....90....1
Applying patches... done.
Fetching 6 files... done.
The following files will be added as part of updating to
-11.4-RELEASE-p1:
+13.1-RELEASE-p1:
/usr/src/contrib/unbound/.github
/usr/src/contrib/unbound/.github/FUNDING.yml
/usr/src/contrib/unbound/contrib/drop2rpz
@@ -1218,14 +1170,14 @@ The following files will be added as part of updating to
/usr/src/contrib/unbound/services/rpz.h
/usr/src/lib/libc/tests/gen/spawnp_enoexec.sh
The following files will be updated as part of updating to
-11.4-RELEASE-p1:
+13.1-RELEASE-p1:
[…]
Installing updates...Scanning //usr/share/certs/blacklisted for certificates...
Scanning //usr/share/certs/trusted for certificates...
done.
-11.4-RELEASE-p1
+13.1-RELEASE-p1
[00:04:06] Recording filesystem state for clean... done
-[00:04:07] Jail 11amd64 11.4-RELEASE-p1 amd64 is ready to be used
+[00:04:07] Jail 13amd64 13.1-RELEASE-p1 amd64 is ready to be used
....
[source,shell]
@@ -1239,16 +1191,17 @@ On a single computer, poudriere can build ports with multiple configurations, in
Custom configurations for these combinations are called _sets_.
See the CUSTOMIZATION section of man:poudriere[8] for details after package:ports-mgmt/poudriere[] or package:ports-mgmt/poudriere-devel[] is installed.
-The basic configuration shown here puts a single jail-, port-, and set-specific [.filename]#make.conf# in [.filename]#/usr/local/etc/poudriere.d#.
-The filename in this example is created by combining the jail name, port name, and set name: [.filename]#11amd64-local-workstation-make.conf#.
-The system [.filename]#make.conf# and this new file are combined at build time to create the [.filename]#make.conf# used by the build jail.
+The basic configuration shown here puts a single jail-, port-, and set-specific `make.conf` in `/usr/local/etc/poudriere.d`.
+The filename in this example is created by combining the jail name, port name, and set name: `13amd64-local-workstation-make.conf`.
+The system `make.conf` and this new file are combined at build time to create the `make.conf` used by the build jail.
-Packages to be built are entered in [.filename]#11amd64-local-workstation-pkglist#:
+Packages to be built are entered in `13amd64-local-workstation-pkglist` (ports with extref:{porters-handbook}flavors[FLAVORS] can be defined with @FLAVOR):
[.programlisting]
....
editors/emacs
devel/git
+devel/php-composer2@php82
ports-mgmt/pkg
...
....
@@ -1257,28 +1210,28 @@ Options and dependencies for the specified ports are configured:
[source,shell]
....
-# poudriere options -j 11amd64 -p local -z workstation -f 11amd64-local-workstation-pkglist
+# poudriere options -j 13amd64 -p local -z workstation -f 13amd64-local-workstation-pkglist
....
Finally, packages are built and a package repository is created:
[source,shell]
....
-# poudriere bulk -j 11amd64 -p local -z workstation -f 11amd64-local-workstation-pkglist
+# poudriere bulk -j 13amd64 -p local -z workstation -f 13amd64-local-workstation-pkglist
....
While running, pressing kbd:[Ctrl+t] displays the current state of the build.
-Poudriere also builds files in [.filename]#/poudriere/logs/bulk/jailname# that can be used with a web server to display build information.
+poudriere also builds files in `/poudriere/logs/bulk/jailname` that can be used with a web server to display build information.
After completion, the new packages are now available for installation from the poudriere repository.
For more information on using poudriere, see man:poudriere[8] and the main web site, https://github.com/freebsd/poudriere/wiki[].
-=== Configuring pkg Clients to Use a Poudriere Repository
+=== Configuring pkg Clients to Use a poudriere Repository
While it is possible to use both a custom repository along side of the official repository, sometimes it is useful to disable the official repository.
This is done by creating a configuration file that overrides and disables the official configuration file.
-Create [.filename]#/usr/local/etc/pkg/repos/FreeBSD.conf# that contains the following:
+Create `/usr/local/etc/pkg/repos/FreeBSD.conf` that contains the following:
[.programlisting]
....
@@ -1288,15 +1241,25 @@ FreeBSD: {
....
Usually it is easiest to serve a poudriere repository to the client machines via HTTP.
-Set up a webserver to serve up the package directory, for instance: [.filename]#/usr/local/poudriere/data/packages/11amd64#, where [.filename]#11amd64# is the name of the build.
+Set up a webserver to serve up the package directory, for instance: `/usr/local/poudriere/data/packages/13amd64`, where `13amd64` is the name of the build.
+
+If the URL to the package repository is: `http://pkg.example.com/13amd64`,
+then the repository configuration file in `/usr/local/etc/pkg/repos/custom.conf` would look like:
+
+[.programlisting]
+....
+custom: {
+ url: "http://pkg.example.com/13amd64",
+ enabled: yes,
+}
+....
-If the URL to the package repository is: `http://pkg.example.com/11amd64`,
-then the repository configuration file in [.filename]#/usr/local/etc/pkg/repos/custom.conf# would look like:
+If exposing the package repository to the internet is not desired, the `file://` protocol can be used to point to the repository directly:
[.programlisting]
....
custom: {
- url: "http://pkg.example.com/11amd64",
+ url: "file:///usr/local/poudriere/data/packages/11amd64",
enabled: yes,
}
....
@@ -1307,9 +1270,9 @@ custom: {
Regardless of whether the software was installed from a binary package or port, most third-party applications require some level of configuration after installation.
The following commands and locations can be used to help determine what was installed with the application.
-* Most applications install at least one default configuration file in [.filename]#/usr/local/etc#. In cases where an application has a large number of configuration files, a subdirectory will be created to hold them. Often, sample configuration files are installed which end with a suffix such as [.filename]#.sample#. The configuration files should be reviewed and possibly edited to meet the system's needs. To edit a sample file, first copy it without the [.filename]#.sample# extension.
-* Applications which provide documentation will install it into [.filename]#/usr/local/share/doc# and many applications also install manual pages. This documentation should be consulted before continuing.
-* Some applications run services which must be added to [.filename]#/etc/rc.conf# before starting the application. These applications usually install a startup script in [.filename]#/usr/local/etc/rc.d#. See crossref:config[configtuning-starting-services,Starting Services] for more information.
+* Most applications install at least one default configuration file in `/usr/local/etc`. In cases where an application has a large number of configuration files, a subdirectory will be created to hold them. Often, sample configuration files are installed which end with a suffix such as `.sample`. The configuration files should be reviewed and possibly edited to meet the system's needs. To edit a sample file, first copy it without the `.sample` extension.
+* Applications which provide documentation will install it into `/usr/local/share/doc` and many applications also install manual pages. This documentation should be consulted before continuing.
+* Some applications run services which must be added to `/etc/rc.conf` before starting the application. These applications usually install a startup script in `/usr/local/etc/rc.d`. See crossref:config[configtuning-starting-services,Starting Services] for more information.
+
[NOTE]
====
@@ -1326,7 +1289,7 @@ This decision is left to the individual system administrator.
When a port does not build or install, try the following:
. Search to see if there is a fix pending for the port in the link:https://www.FreeBSD.org/support/[Problem Report database]. If so, implementing the proposed fix may fix the issue.
-. Ask the maintainer of the port for help. Type `make maintainer` in the ports skeleton or read the port's [.filename]#Makefile# to find the maintainer's email address. Remember to include the output leading up to the error in the email to the maintainer.
+. Ask the maintainer of the port for help. Type `make maintainer` in the ports skeleton or read the port's `Makefile` to find the maintainer's email address. Remember to include the output leading up to the error in the email to the maintainer.
+
[NOTE]
====