Dragonfly BSD 4.0.x



Package Management in Dragonfly BSD

Pkg (pkgng)

Since Version 3.4 Dragonfly BSD comes by default with the new pkg (pkgng) System.

Pkg is the Next Generation package management tool, initially developed for FreeBSD.

Ist is similar to the Linux apt and rpm-Management-Systems

Package sources

Edit /usr/local/etc/pkg/repos/df-latest.conf and activate your nearest mirror. For Germany choose ?SchlundundTech. Deactivate Avalon.

Avalon: {
       enabled         : no
SchlundTech: {
        url             : http://dfly.schlundtech.de/dports/${ABI}/LATEST,
        enabled         : yes

Now update the Repository and start installing stuff.

mail# pkg update 

Using pkg

Installing Software

pkg install wget 

Show installed Software

pkg info 


pkg search dovecot2

Checking Compiler-Options

pkg query '%Ok %Ov %Od %OD' postfix 

Locking Packages

When you install Packages from dports, who don't want pkg to update them.

pkg lock postfix 

Securing the pkg-database

Pkg makes use of an SQlite-Database. Backup it by typing.

pkg backup -d pkgng.db

For Details see here: https://www.freebsd.org/doc/handbook/pkgng-intro.html


size mismatch

Pkg reports a size mismatch in one of the packages :

Fetching moinmoin-1.9.7.txz: 100%    8 MB 635.9k/s    00:13    
pkg: cached package moinmoin-1.9.7: size mismatch, fetching from remote
Fetching moinmoin-1.9.7.txz: 100%    8 MB 635.9k/s    00:13    
pkg: cached package moinmoin-1.9.7: size mismatch, cannot continue

Solution: Clean the cache

# rm -rf /var/cache/pkg/*
# pkg clean
# pkg update


Dports (Delta Ports) is the ports-Version for Dragonfly BSD. If Packages in pkg don't suite your needs (Compiler-Options) who can build them from dports.

Required Software

pkg install git dialog4ports

Aquiring the dports-tree

# cd /usr
# make dports-create-shallow

Update dports

# cd /usr/dports/
# git pull 

Dports without X11

Servers don't need X11 Dependencies. You can deactivate them by editing /etc/make.conf

WITHOUT_X11=    yes

Compiling & Installing Software

locate your Software

In this example we will install dovecot2

# whereis  dovecot2
dovecot2: /usr/dports/mail/dovecot2

Are you inside a Jail ?

If yes, how did you enter the Jail ? People using the jexec commando from the host side have to start tmux due to lack of an tty. If not present install it using pkg.

# pkg install tmux
# rehash 
# tmux 

Configure, build & install

# cd /usr/dports/mail/dovecot2
# make config 
# make && make install && make clean 
# rehash 

Don't forget to lock your port, if you are using special compiler options.

# pkg lock dovecot2 

Updating Software

You can update Software by recompiling it. After Compilation you have to use the commandos make deinstall and make reinstall.

Here's an example:

# cd /usr/dports/mail/dovecot2
# pkg unlock dovecot2
# make config 
# make 
# make deinstall 
# make reinstall
# make clean  
# rehash 
# pkg lock dovecot2


Dragonfly BSD/Package Management (last edited 2015-04-12 15:46:35 by jackhammer)