Dports management

DragonFlyBSD was based on NetBSD’s pkgsrc. Since DragonFlyBSD 3.4, FreeBSD port tree has been ported to DragonFly, and renamed it dports.

Ports tree

The ports tree containt all softwares. It’s an essential element for 3rd softwares and libraries. Each port is categorized in one directory (databases, www, converters…)

Get the first snapshot

DragonFlyBSD is based on git to get the ports tree. To extract first snapshot, we use this command:

cd /usr
make dports-create-shallow

This command will clone git repository to /usr/dports directory. You can note that the repository is on github.

Update tree

Like git, here is the command to update the tree.

cd /usr/dports
git pull

Ports management

To see the installed port list:

pkg info

Install a port

To install a port, you must go to the good directory (here mysql 5.5 service) and type make install clean

cd /usr/dports/databases/mysql55-server
make install clean

This make command will compile, install files and clean compile files. In some cases, ports need some hacks, then a dialog window will appear to let you choose compile options.

Change the port configuration

If you have done a mistake, or you need to add some functions, you may want to reconfigure port. Go to the port directory and type:

make config

Update management

To manage update, we will use the better product for FreeBSD, which works also on DragonFlyBSD: portmaster. Then we compile it:

cd /usr/dports/port-mgmt/portmaster
make install clean

Now, to update all installed ports, you can type:

portmaster -a

Compile all installed ports

After an OS migration, it would be interesting to compile all ports, because of system libraries updates. This is recommended. You can force update of all ports, which recompile all of them.

portmaster -af

Uninstall a port

Two method exists, the first is to go to port directory and type:

make deinstall

The second method is proper and manage dependencies is to do a pkg info to find the port and then a pkg delete of the port (+ version)

pkg delete zsh-5.0.2