Ports or Packages?

Do you compile ports, use binary packages, or mix both?


  • Total voters
    35
Unless you have a compelling reason otherwise, install packages. Packages are just pre-configured, general purpose ports. If you need something custom for your situation, use a port. In most cases, you don't. No poll needed.
 
Both is a minority? I do that as long as I remember. What can cause problems? Ok, I know how to solve version conflicts, but that's no must to use both.
 
I maintain 2 servers and because I'm very specific (and picky!) with my security demands I build everything from source. So both the base OS itself, as well as all 3rd party software on top of it (I'm very keen on ports-mgmt/portmaster). In my opinion the first advantage you can get with regards to security aspects is customization: making sure that your setup doesn't match "the generic design". Take Apache's WebDAV: I don't trust it, I don't need it and such I made sure that my copy doesn't have these options available at all, simply because the modules aren't build.

Of course I also don't see the need of wasting resources, so I made sure that all build packages get added to a local repository so that my backup server can simply re-use them. Build once, install twice ;)

I'm hoping that's what people meant when they voted "both"... because you really don't want to mix ports & packages if it can be helped.
 
I basically build locally from ports, but when I don't have enough time (especially non-daily driver main [aka CURRENT] environment that lives in exactly same computer but different drive), use official pkgs for too large leaf ports like www/chromium.
 
Packages; I reinstall often and like getting back up quick, and like running stuff like majority of others (easier troubleshooting and community discussions)

Plus I'd probably end up trying -Ofast and spend hours on optimization flags everywhere :p
 
some packages badly need a "lite" version because they are overbloated
ImageMagick7 + default deps is 3.5GB, ffmpeg 1.5GB
more than 10% of packages (+ their deps) are over 1GB
every package other looks like bringing in python which is a quarter of a gig itself
 
ImageMagick7 + default deps is 3.5GB, ffmpeg 1.5GB
Both have a nox11 flavor. That will cut down the dependency list quite a bit. Provided you don't need any of those dependencies of course.

Unfortunately if you have something that depends on ffmpeg or ImageMagick7 it'll pull in the "full" flavor, not the nox11 one. At least in the FreeBSD repositories. If you build your own packages you can drastically reduce that dependency list.
 
- use binary packages
- build any packages that require customizations with poudriere
- use a local pkg caching server (Nginx) for everything, including canonical repositories, to setup VMs or jails to speed up and reduce traffic
 
sh:
sqlite3 /var/db/pkg/repos/FreeBSD/db 'select name,flatsize, group_concat(dname),count(distinct dname) c  from (select packages.name, flatsize, deps.name as dname from packages left outer join deps on packages.id=deps.package_id) l group by name order by name;' |awk -f cl.awk |sort -k2,2 -h
Code:
#!/usr/bin/awk -f
# Input lines: name|size|dep1,dep2,...|something
# Usage: some_command | awk -f script.awk

function hrf(bytes,    units, idx, val) {
    split("B K M G", units, " ")
    idx = 1
    val = bytes + 0
    while (val >= 1024 && idx < 4) {
        val /= 1024
        idx++
    }
    return sprintf("%.2f%s", val, units[idx])
}

function rsize(p,    s, n, i, deps) {
    if (p in visited)
        return 0
    if (!(p in size)) {
        print "Warning " p " does not exist as package, only as a dep" > "/dev/stderr"
        return 0
    }
    visited[p] = 1

    s = size[p]
    n = split(dep[p], deps, ",")
    for (i = 1; i <= n; i++)
        s += rsize(deps[i])
    return s
}

BEGIN { FS = "|" }

{
    # Tcl version stops reading at the first line without exactly 4 fields
    if (done || NF != 4) { done = 1; next }

    if (!($1 in size))
        order[++count] = $1      # keep insertion order, like a Tcl dict
    size[$1] = $2 + 0
    dep[$1]  = $3
}

END {
    for (i = 1; i <= count; i++) {
        k = order[i]
        delete visited           # fresh visited set per package
        print k, hrf(rsize(k))
    }
}

the bloatware at it's finest
for pkg-base use /var/db/pkg/repos/FreeBSD-ports/db in the sqlite3 cmd
 
Those are build dependencies?
no they are not. im pulling the data from the repo sqlite db and there are no build depends there
gcc is need for fortran for numpy or something
llvm probably to jit something, python for whatever
Code:
root@instance-20260827-1504 ~]# pkg install ImageMagick7
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
Updating FreeBSD-ports-kmods repository catalogue...
FreeBSD-ports-kmods repository is up to date.
Updating FreeBSD-base repository catalogue...
FreeBSD-base repository is up to date.
All repositories are up to date.
The following 113 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    ImageMagick7: 7.1.2.34 [FreeBSD-ports]
    Imath: 3.2.3_1 [FreeBSD-ports]
    aom: 3.15.2 [FreeBSD-ports]
    binutils: 2.44,1 [FreeBSD-ports]
    cairo: 1.18.6,3 [FreeBSD-ports]
    cups: 2.4.20 [FreeBSD-ports]
    dav1d: 1.5.4_1 [FreeBSD-ports]
    ffmpeg: 9.0.2_3,1 [FreeBSD-ports]
    fftw3: 3.3.11 [FreeBSD-ports]
    fontconfig: 2.18.3,1 [FreeBSD-ports]
    freetype2: 2.14.3 [FreeBSD-ports]
    fribidi: 1.0.17 [FreeBSD-ports]
    gcc14: 14.2.0_7 [FreeBSD-ports]
    gdk-pixbuf2: 2.44.1 [FreeBSD-ports]
    ghostscript10: 10.08.0 [FreeBSD-ports]
    giflib: 6.1.3 [FreeBSD-ports]
    graphite2: 1.3.15_1 [FreeBSD-ports]
    gsfonts: 8.11_8 [FreeBSD-ports]
    harfbuzz: 14.6.0 [FreeBSD-ports]
    highway: 1.4.0 [FreeBSD-ports]
    hwdata: 0.412,1 [FreeBSD-ports]
    jbig2dec: 0.20_1 [FreeBSD-ports]
    jbigkit: 2.1_3 [FreeBSD-ports]
    jpeg-turbo: 3.1.4.1 [FreeBSD-ports]
    lame: 4.0 [FreeBSD-ports]
    lcms2: 2.19.1 [FreeBSD-ports]
    lerc: 4.2.0 [FreeBSD-ports]
    libXScrnSaver: 1.2.5 [FreeBSD-ports]
    libXcursor: 1.2.3 [FreeBSD-ports]
    libXdamage: 1.1.7 [FreeBSD-ports]
    libXext: 1.3.7,1 [FreeBSD-ports]
    libXfixes: 6.0.2 [FreeBSD-ports]
    libXft: 2.3.9 [FreeBSD-ports]
    libXi: 1.8.4,1 [FreeBSD-ports]
    libXrandr: 1.5.5 [FreeBSD-ports]
    libXrender: 0.9.13 [FreeBSD-ports]
    libXt: 1.3.1,1 [FreeBSD-ports]
    libXv: 1.0.13,1 [FreeBSD-ports]
    libXxf86vm: 1.1.7 [FreeBSD-ports]
    libass: 0.17.5 [FreeBSD-ports]
    libbluray: 1.5.1,1 [FreeBSD-ports]
    libdatrie: 0.2.14_1 [FreeBSD-ports]
    libdeflate: 1.26 [FreeBSD-ports]
    libdisplay-info: 0.4.0 [FreeBSD-ports]
    libdrm: 2.4.134,1 [FreeBSD-ports]
    libdvdnav: 7.0.0 [FreeBSD-ports]
    libdvdread: 7.1.1 [FreeBSD-ports]
    libepoll-shim: 0.0.20240608 [FreeBSD-ports]
    libfontenc: 1.1.9 [FreeBSD-ports]
    libgd: 2.3.3_13,1 [FreeBSD-ports]
    libglvnd: 1.7.0 [FreeBSD-ports]
    libheif: 1.23.6 [FreeBSD-ports]
    libidn: 1.44 [FreeBSD-ports]
    libjxl: 0.12.0 [FreeBSD-ports]
    liblqr-1: 0.4.2 [FreeBSD-ports]
    libltdl: 2.6.2 [FreeBSD-ports]
    libogg: 1.3.6,4 [FreeBSD-ports]
    libpciaccess: 0.19 [FreeBSD-ports]
    libplacebo: 7.387.0 [FreeBSD-ports]
    libraqm: 0.11.0 [FreeBSD-ports]
    libraw: 0.22.2 [FreeBSD-ports]
    librsvg2-rust: 2.62.3_3 [FreeBSD-ports]
    libthai: 0.1.30 [FreeBSD-ports]
    libudev-devd: 0.7.0 [FreeBSD-ports]
    libudfread: 1.2.0 [FreeBSD-ports]
    libunibreak: 7.0,1 [FreeBSD-ports]
    libv4l: 1.23.0_5 [FreeBSD-ports]
    libva: 2.24.1 [FreeBSD-ports]
    libvdpau: 1.5 [FreeBSD-ports]
    libvorbis: 1.3.7_2,3 [FreeBSD-ports]
    libvpx: 1.17.0 [FreeBSD-ports]
    libwmf: 0.2.16 [FreeBSD-ports]
    libx264: 0.165.3223_1 [FreeBSD-ports]
    libxkbcommon: 1.13.2 [FreeBSD-ports]
    libxshmfence: 1.3.3 [FreeBSD-ports]
    libzip: 1.12.1 [FreeBSD-ports]
    llvm19: 19.1.7_4 [FreeBSD-ports]
    lua53: 5.3.6_1 [FreeBSD-ports]
    lzo2: 2.10_2 [FreeBSD-ports]
    mesa-libs: 26.2.2_1 [FreeBSD-ports]
    mkfontscale: 1.2.4 [FreeBSD-ports]
    mpc: 1.4.1 [FreeBSD-ports]
    mpg123: 1.33.7 [FreeBSD-ports]
    openblas: 0.3.34_1,2 [FreeBSD-ports]
    openexr: 3.4.16 [FreeBSD-ports]
    openh264: 2.6.0_1,2 [FreeBSD-ports]
    openjpeg: 2.5.4_2 [FreeBSD-ports]
    openjph: 0.32.0 [FreeBSD-ports]
    opus: 1.6.1 [FreeBSD-ports]
    pango: 1.57.1 [FreeBSD-ports]
    pixman: 0.46.4 [FreeBSD-ports]
    poppler-data: 0.4.12 [FreeBSD-ports]
    py312-boost-libs: 1.92.0 [FreeBSD-ports]
    py312-numpy: 2.4.6_1,1 [FreeBSD-ports]
    sdl2: 2.32.10_2 [FreeBSD-ports]
    shaderc: 2026.4_1 [FreeBSD-ports]
    shared-mime-info: 2.4_2 [FreeBSD-ports]
    spirv-llvm-translator-llvm19: 19.1.23 [FreeBSD-ports]
    spirv-tools: 2026.4 [FreeBSD-ports]
    srt: 1.5.7_1 [FreeBSD-ports]
    svt-av1: 4.2.0 [FreeBSD-ports]
    tiff: 4.7.2 [FreeBSD-ports]
    urw-base35-fonts: 20200910 [FreeBSD-ports]
    vmaf: 3.2.1 [FreeBSD-ports]
    vulkan-loader: 1.4.365 [FreeBSD-ports]
    wayland: 1.26.0 [FreeBSD-ports]
    webp: 1.6.0 [FreeBSD-ports]
    x265: 4.3 [FreeBSD-ports]
    xkeyboard-config: 2.48 [FreeBSD-ports]

Installed packages to be UPGRADED:
    boost-libs: 1.91.0 -> 1.92.0 [FreeBSD-ports]
    galera26: 26.4.27 -> 26.4.27_1 [FreeBSD-ports]
    gdb: 15.1_6 -> 15.1_7 [FreeBSD-ports]
    source-highlight: 3.1.9_16 -> 3.1.9_17 [FreeBSD-ports]

Number of packages to be installed: 109
Number of packages to be upgraded: 4

The process will require 3 GiB more space.
529 MiB to be downloaded.
 
gcc is need for fortran for numpy or something
llvm probably to jit something, python for whatever
Reverse chase, binutils -> gcc14 -> py-numpy -> Imath -> openexr

I have OPENEXR : off yet it still pulls in OpenExr (which then pulls in gcc, binutils, numpy, etc).

Ah, it gets in through a different dependency:
Code:
# pkg info -r openexr
openexr-3.4.16:
        libjxl-0.12.0
        libjxl-0.12.0 (libIex-3_4.so.33)
        libjxl-0.12.0 (libOpenEXR-3_4.so.33)
root@riviera:~ # pkg info -r libjxl
libjxl-0.12.0:
        ImageMagick7-nox11-7.1.2.34
        ffmpeg-9.0.2_3,1
        ffmpeg-9.0.2_3,1 (libjxl.so.0.12)
        ImageMagick7-nox11-7.1.2.34 (libjxl.so.0.12)
        ffmpeg-9.0.2_3,1 (libjxl_threads.so.0.12)
        ImageMagick7-nox11-7.1.2.34 (libjxl_threads.so.0.12)
So, another option (JXL) I need to UNSET. And FFMPEG, and HEIF (that pulls in ffmpeg too).

There, much better now:
Code:
New packages to be INSTALLED:
        ImageMagick7-nox11: 7.1.2.34 [dicelan-server]
        Imath: 3.2.3_1 [dicelan-server]
        boost-libs: 1.92.0 [dicelan-server]
        fftw3: 3.3.11 [dicelan-server]
        gdk-pixbuf2: 2.44.1 [dicelan-server]
        ghostscript10: 10.08.0 [dicelan-server]
        gsfonts: 8.11_8 [dicelan-server]
        highway: 1.4.0 [dicelan-server]
        icu: 76.1,1 [dicelan-server]
        jbig2dec: 0.20_1 [dicelan-server]
        libidn: 1.44 [dicelan-server]
        libjxl: 0.12.0 [dicelan-server]
        liblqr-1: 0.4.2 [dicelan-server]
        libltdl: 2.6.2 [dicelan-server]
        libpaper: 1.1.28_1 [dicelan-server]
        libraw: 0.22.2 [dicelan-server]
        libwmf-nox11: 0.2.16 [dicelan-server]
        libzip: 1.12.1 [dicelan-server]
        openblas: 0.3.34_1,2 [dicelan-server]
        openexr: 3.4.16 [dicelan-server]
        openjpeg: 2.5.4_2 [dicelan-server]
        openjph: 0.32.0 [dicelan-server]
        pkgconf: 3.0.9,1 [dicelan-server]
        poppler-data: 0.4.12 [dicelan-server]
        py312-boost-libs: 1.92.0 [dicelan-server]
        py312-numpy: 2.4.6_1,1 [dicelan-server]
        shared-mime-info: 2.4_2 [dicelan-server]
        urw-base35-fonts: 20200910 [dicelan-server]

Number of packages to be installed: 28

The process will require 689 MiB more space.
105 MiB to be downloaded.
Although I still see openexr being pulled in for some reason. More chasing is required it seems.

(This is one of the perks building your packages give you)
Code:
graphics_ImageMagick7_UNSET= OPENEXR SVG PANGO RAQM HEIF FFMPEG

Edit: Ah, forgot to switch off JXL.

Edit2: While openexr still got pulled in, gcc14 and binutils aren't. Something fishy is going on regarding that gcc14 dependency.
 
Unless you have a compelling reason otherwise, install packages. Packages are just pre-configured, general purpose ports. If you need something custom for your situation, use a port. In most cases, you don't. No poll needed.
Yep, i used to compile my own years ago, but these days I just use packages for most things. I just haven't had the need most of the time.

The more interesting question is whether to isolate or not.
 
There we go, this is probably as "clean" as I can get it.
Code:
New packages to be INSTALLED:
        ImageMagick7-nox11: 7.1.2.34 [dicelan-server]
        fftw3: 3.3.11 [dicelan-server]
        gdk-pixbuf2: 2.44.1 [dicelan-server]
        ghostscript10: 10.08.0 [dicelan-server]
        gsfonts: 8.11_8 [dicelan-server]
        jbig2dec: 0.20_1 [dicelan-server]
        libidn: 1.44 [dicelan-server]
        liblqr-1: 0.4.2 [dicelan-server]
        libltdl: 2.6.2 [dicelan-server]
        libpaper: 1.1.28_1 [dicelan-server]
        libraw: 0.22.2 [dicelan-server]
        libwmf-nox11: 0.2.16 [dicelan-server]
        libzip: 1.12.1 [dicelan-server]
        openjpeg: 2.5.4_2 [dicelan-server]
        pkgconf: 3.0.9,1 [dicelan-server]
        poppler-data: 0.4.12 [dicelan-server]
        shared-mime-info: 2.4_2 [dicelan-server]
        urw-base35-fonts: 20200910 [dicelan-server]

Number of packages to be installed: 18

The process will require 115 MiB more space.
39 MiB to be downloaded.
Code:
graphics_ImageMagick7_UNSET= OPENEXR SVG PANGO RAQM HEIF FFMPEG JXL
 
playing with this i found other problems, like some packages only exist in the 'deps' table but not in packages
try for example
pkg rquery "%n, (%c) depends on %dn" dsd
pkg install dsd

mbelib does not exist
 
looks like a license problem because of how the others look

eawpats ===> audio/timidity++, audio/eawplus
festlex-oald ===> audio/festvox-rab8, audio/festvox-don, audio/festvox-rab16
fretsonfire-data ===> games/fretsonfire
gnome-icons-aqua-fusion ===> x11-themes/gnome-icons
gnome-icons-crystal ===> x11-themes/gnome-icons
gnome-icons-gentoo-test ===> x11-themes/gnome-icons
gnome-icons-iris ===> x11-themes/gnome-icons
gnome-icons-lila ===> x11-themes/gnome-icons
gnome-icons-noia-full ===> x11-themes/gnome-icons
gnome-icons-noia-warm ===> x11-themes/gnome-icons
gnome-icons-refined ===> x11-themes/gnome-icons
gnome-icons-slick ===> x11-themes/gnome-icons
gnome-icons-snow-apple ===> x11-themes/gnome-icons
gnome-icons-stylish ===> x11-themes/gnome-icons
gnome-icons-ximian-south ===> x11-themes/gnome-icons
libdvdcss ===> multimedia/dvdread
mbelib ===> comms/dsd, comms/digiham
metacity-theme-microgui ===> x11-themes/metacity-themes
 
There we go, this is probably as "clean" as I can get it.
Code:
New packages to be INSTALLED:
        ImageMagick7-nox11: 7.1.2.34 [dicelan-server]
        fftw3: 3.3.11 [dicelan-server]
        gdk-pixbuf2: 2.44.1 [dicelan-server]
        ghostscript10: 10.08.0 [dicelan-server]
        gsfonts: 8.11_8 [dicelan-server]
        jbig2dec: 0.20_1 [dicelan-server]
        libidn: 1.44 [dicelan-server]
        liblqr-1: 0.4.2 [dicelan-server]
        libltdl: 2.6.2 [dicelan-server]
        libpaper: 1.1.28_1 [dicelan-server]
        libraw: 0.22.2 [dicelan-server]
        libwmf-nox11: 0.2.16 [dicelan-server]
        libzip: 1.12.1 [dicelan-server]
        openjpeg: 2.5.4_2 [dicelan-server]
        pkgconf: 3.0.9,1 [dicelan-server]
        poppler-data: 0.4.12 [dicelan-server]
        shared-mime-info: 2.4_2 [dicelan-server]
        urw-base35-fonts: 20200910 [dicelan-server]

Number of packages to be installed: 18

The process will require 115 MiB more space.
39 MiB to be downloaded.
Code:
graphics_ImageMagick7_UNSET= OPENEXR SVG PANGO RAQM HEIF FFMPEG JXL
Good job on decreasing the amount of dependencies. That's a great example of why ports, on the other hand I guess that random users of Imagemagik might want to just download it to handle some conversion from jxl to svg for example.
What I think FreeBSD is missing is an easy way to split packages, the current falvour approach is a pain.
 
Back
Top