My Straightforward Guide For Setting Up Poudriere On FreeBSD

Written by: Donovan / Last updated: Apr 27, 2019

Poudriere is by far my favorite FreeBSD tool and one I use almost daily for stable, customized package management. Here’s the step-by-step guide I made (for myself) to set it up.

People asked for this so I’m posting it (plus it’s a great reference for me in case I forget!).

Let me know if I’ve missed anything.

The nginx part is optional but I’ll leave that in here.

1. Install poudriere (obviously) and nginx (if you want to)

doas pkg install poudriere nginx

2. Edit config

doas vim /usr/local/etc/poudriere.conf

ZPOOL=zroot
ZROOTFS=/poudriere

FREEBSD_HOST=ftp://ftp.freebsd.org

POUDRIERE_DATA=${BASEFS}/data
CHECK_CHANGED_OPTIONS=verbose
CHECK_CHANGED_DEPS=yes

URL_BASE=http://localhost/

3. Create jail

doas poudriere jail -c -j freebsd_12-0x64 -v 12.0-RELEASE

doas poudriere jail -l

4. Retrieve ports

doas poudriere ports -c -p PORTS

doas poudriere ports -l

5. Create port-list

doas vim /usr/local/etc/poudriere.d/port-list

audio/lame
multimedia/ffmpeg

6. Build the ports

doas poudriere options -c -j freebsd_12-0x64 -p HEAD -f /usr/local/etc/poudriere.d/port-list

doas poudriere bulk -j freebsd_12-0x64 -p PORTS -f /usr/local/etc/poudriere.d/port-list

7. Nginx server block

doas vim /usr/local/etc/nginx/nginx.conf

    server {
        listen 8000;
        server_name localhost;
        root /usr/local/share/poudriere/html;

        location /data {
            alias /usr/local/poudriere/data/logs/bulk;
            autoindex on;
        }

        location /packages {
            root /usr/local/poudriere/data;
            autoindex on;
        }
    }

8. Nginx log mime type

doas vim /usr/local/etc/nginx/mime.types

    text/plain                          txt log;

9. Restart nginx

doas service nginx restart

10. Configure repos

doas vim /usr/local/etc/pkg/repos/poudriere.conf

    poudriere: {
        url: "file:///usr/local/poudriere/data/packages/freebsd_11-2x64-PORTS",
        mirror_type: "srv",
        signature_type: NONE,
        enabled: yes,
        priority: 1
    }

doas vim /usr/local/etc/pkg/repos/freebsd.conf

    FreeBSD: {
    	enabled: no
    }

doas pkg update

11. Installing custom packages

doas pkg install -package-

If package is already installed, reinstall with:

doas pkg install -r poudriere -f -package-

12. Updating

doas poudriere jail -u -j freebsd_12-0x64

doas poudriere ports -u -p PORTS

13. Upgrading packages

Basically rinse and repeat Steps 5 and 6.


Done.

Some of the steps will depend on your situation (e.g. FreeBSD version, packages, enabling/disabling FreeBSD repo, nginx). Customize accordingly.

View Archive