ports¶
ports intro¶
The ports collection is a way to install thrid party software on a FreeBSD server.
ports tips¶
Updating available port list
csup -L 2 -h cvsup1.fr.FreeBSD.org /usr/share/examples/cvsup/ports-supfile
Installing portmaster
cd /usr/ports/ports-mgmt/portmaster
make install clean
Deleting one program/lib (and force in case of unmet dependencies)
pkg_delete xf86bigfontproto-1.2.0
pkg_delete -f xf86bigfontproto-1.2.0
Using portmaster
portmaster -L #list installed ports and available updates.
Clean stale files
cd /usr/ports && make -DNOCLEANDEPENDS clean
yes|portmaster -t --clean-distfiles #usually without -t
In case of missing dependencies, you might get errors like these :
pkg_info: corrupted record (pkgdep line without argument), ignoring
Search for missing dependencies
cd /usr/ports/cat/portname
make missing
Search for all missing dependencies
grep -A1 "^@pkgdep $" /var/db/pkg/*/+CONTENTS
Search ports
cd /usr/ports && make index
make search name=<port-name>
make search key=<keyword>
Display the port who has installed a specified file:
pkg_info -W /usr/local/bin/sudo
/usr/local/bin/sudo was installed by package sudo-1.8.1_5
pkg which "/usr/local/libexec/courier-imap/couriertcpd"
/usr/local/libexec/courier-imap/couriertcpd was installed by package courier-imap-4.15_2,2
Replace a port:
portmaster -o databases/postgresql10-client postgresql93-client
Display the files that where installed by a specific port:
pkg_info -L nagios-plugins-1.4.15_1,1
Information for nagios-plugins-1.4.15_1,1:
Files:
/home/local/libexec/nagios/check_apt
/home/local/libexec/nagios/check_breeze
/home/local/libexec/nagios/check_by_ssh
...