Sep 19, 2019 Installing and maintaining the FreeBSD Ports Collection or FreeBSD Packages (i.e. Third party software).
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
/usr/ports .
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:
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. 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.
If more control over the ports tree is needed or if local changes need to be maintained, Subversion can be used to obtain the Ports Collection. Refer to the Subversion Primer for a detailed description of Subversion.
The Ports Collection contains directories for software categories. 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:
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 FreeBSD Porter's Handbook.
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 .
This section provides basic instructions on using the Ports Collection to install or remove software. The detailed description of available
make targets and environment variables is available in ports(7).
Warning: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
Using the Ports Collection assumes a working Internet connection. It also requires superuser privilege.
To compile and install the port, change to the directory of the port to be installed, then type
make install at the prompt. Messages will indicate the progress:
Since
lsof is a program that runs with increased privileges, a security warning is displayed as it is installed. Once the installation is complete, the prompt will be returned.
Some shells keep a cache of the commands that are available in the directories listed in the
PATH environment variable, to speed up lookup operations for the executable file of these commands. Users of the tcsh shell should type rehash so that a newly installed command can be used without specifying its full path. Use hash -r instead for the sh shell. Refer to the documentation for the shell for more information.
During installation, a working subdirectory is created which contains all the temporary files used during compilation. Removing this directory saves disk space and minimizes the chance of problems later when upgrading to the newer version of the port:
Note:To save this extra step, instead use
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 www/firefox, security/gpgme, and mail/sylpheed-claws. 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. Then, run make install [clean] to compile and install the port.
Tip:When using
There are several ways to revisit a port's build options menu in order to add, remove, or change these options after a port has been built. One method is to
cd into the directory containing the port and type make config . Another option is to use make showconfig . Another option is to execute make rmconfig which will remove all selected options and allow you to start over. All of these options, and others, are explained in great detail in ports(7).
The ports system uses fetch(1) to download the source files, which supports various environment variables. 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 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 /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 Makefile . When using, specify the alternate location:
The
WRKDIRPREFIX and PREFIX variables can override the default working and target directories. For example:
will compile the port in
/usr/home/example/ports and install everything under /usr/local .
will compile the port in
/usr/ports and install it in /usr/home/example/local . And:
will combine the two.
These can also be set as environmental variables. Refer to the manual page for your shell for instructions on how to set an environmental variable.
Installed ports can be uninstalled using
pkg delete . Examples for using this command can be found in the pkg-delete(8) manual page.
Alternately,
make deinstall can be run in the port's directory:
It is recommended to read the messages as the port is uninstalled. If the port has any applications that depend upon it, this information will be displayed but the uninstallation will proceed. In such cases, it may be better to reinstall the application in order to prevent broken dependencies.
Freebsd Install Ports From Dvd
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 Procedure 4.1, “Portsnap Method” or Procedure 4.2, “Subversion 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:
For FreeBSD 9.
X and lower, the following command will list the installed ports that are out of date:
Important:Before attempting an upgrade, read
The Ports Collection contains several utilities to perform the actual upgrade. Each has its strengths and weaknesses.
Historically, most installations used either Portmaster or Portupgrade. Synth is a newer alternative.
Note:The choice of which tool is best for a particular system is up to the system administrator. It is recommended practice to back up your data before using any of these tools.
ports-mgmt/portmaster is a very small utility for upgrading installed ports. It is designed to use the tools installed with the FreeBSD base system without depending on other ports or databases. To install this utility as a port:
Portmaster defines four categories of ports:
To list these categories and search for updates:
This command is used to upgrade all outdated ports:
Note:By default, Portmaster makes a backup package before deleting the existing port. If the installation of the new version is successful, Portmaster deletes the backup. Using
If errors are encountered during the upgrade process, add
-f to upgrade and rebuild all ports:
Portmaster can also be used to install new ports on the system, upgrading all dependencies before building and installing the new port. To use this function, specify the location of the port in the Ports Collection:
More information about ports-mgmt/portmaster may be found in its
pkg-descr .
ports-mgmt/portupgrade is another utility that can be used to upgrade ports. It installs a suite of applications which can be used to manage ports. However, it is dependent upon Ruby. To install the port:
Before performing an upgrade using this utility, it is recommended to scan the list of installed ports using
pkgdb -F and to fix all the inconsistencies it reports.
To upgrade all the outdated ports installed on the system, use
portupgrade -a . Alternately, include -i to be asked for confirmation of every individual upgrade:
To upgrade only a specified application instead of all available ports, use
portupgrade . It is very important to include -R to first upgrade all the ports required by the given application:
![]()
If
-P is included, Portupgrade searches for available packages in the local directories listed in PKG_PATH . https://yellowfamily730.weebly.com/blog/microstation-powerdraft-free-download. If none are available locally, it then fetches packages from a remote site. If packages can not be found locally or fetched remotely, Portupgrade will use ports. To avoid using ports entirely, specify -PP . 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 ports-mgmt/portupgrade may be found in its
pkg-descr .
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 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 work directories found within the local copy of the Ports Collection:
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:
Freebsd Install Ports Without Prompt
Portupgrade can remove all distfiles not referenced by any port currently installed on the system:
If Portmaster is installed, use:
By default, this command is interactive and prompts the user to confirm if a distfile should be deleted.
Freebsd Install Package Manager
In addition to these commands, ports-mgmt/pkg_cutleaves automates the task of removing installed ports that are no longer needed.
Chapter 4. Installing Applications: Packages and Ports
FreeBSD is bundled with a rich collection of system tools as part of the base system. In addition, FreeBSD provides two complementary technologies for installing third-party software: the FreeBSD Ports Collection, for installing from source, and packages, for installing from pre-built binaries. Either method may be used to install software from local media or from the network.
After reading this chapter, you will know:
Freebsd Ports Install Package
All FreeBSD documents are available for download at https://download.freebsd.org/ftp/doc/ Freebsd Package ManagementQuestions that are not answered by the documentation may be sent to <[email protected]>. Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |