HowTo Modern (2018) KDE on FreeBSD

Quite some time ago I wrote a how-to to install modern KDE on FreeBSD. Now that the ports are all in the main tree, things are a lot simpler. So I’m writing it out anew.

  1. VM: Let’s start over with a fresh VirtualBox VM, with a 30GB zvol for storage, 4GB RAM, 4 cores of my desktop CPU.
  2. Basic Install: Get 11.x, amd64. Don’t bother with src or with a ports tree, since this is going to install from packages. I picked auto-UFS, with MBR, the most straightforward setup. IPv4, DHCP, timezone .. for system-hardening options, I added clear /tmp and disable sendmail, nothing else. That whole process took about five minutes.
  3. Initial update: Run pkg once, to install it. Optionally, run freebsd-update to update the installed system to the latest security patches. Optionally, switch to a local pkg repository. Edit: Switch to the non-quarterly package branch, first. Thanks George.
  4. Basic packages: Run pkg repeatedly:

    pkg install xorg xterm twm # basic X
    pkg install sddm kde5 kdevelop kmail # the good stuff (edit: sddm optional!)
    pkg install virtualbox-ose-additions # only if VBox

  5. Service configuration: Add these lines to /etc/rc.conf (as suggested by the pkg-messages):

    dbus_enable="YES"
    sddm_enable="YES" # edit: if you want to
    vboxguest_enable="YES" # only if VBox
    vboxservice_enable="YES" # only if VBox

  6. Sysctl configuration: Add these lines to /etc/sysctl.conf to make sure Akonadi works:

    net.local.stream.recvspace=65536
    net.local.stream.sendspace=65536

  7. Reboot and login

Screenshot

And there’s a few gotcha’s:

  • In VirtualBox, sometimes the screen may not resize when you resize the VM window. That’s not actually a KDE Plasma problem, but you can run randr --output VGA-0 --auto from a konsole to get it to resize.
  • Akonadi may not start. There’s a warning about TIMESTAMP with implicit DEFAULT, something you can find in older KDE Forum posts, too. The fix is mkdir -p ~/.local/share/akonadi/db_data ; akonadictl start .
  • You can logout, but not shutdown from Plasma itself; you can shutdown from SDDM, but don’t count on any feedback after you click on the big red (er .. monochrome) off button.

Edit: 1. The packages are only built on the regular package branch, not quarterly, so you’ll have to switch to that if you want the packages. I didn’t catch that because (right, cheating) I have my own poudriere builds from ports HEAD. 2. SDDM is optional; you can of course use any other DM (be sure to run /usr/local/bin/startkde) or use startx and an .xinitrc file (in that case, use ck-launch-session, so that you can unlock in case of general disaster. 3. Logging goes .. somewhere. Gosh, I can’t find any useful output; we’ll document that on the KDE community wiki once it’s been tracked down. In the meantime, kdebugdialog5 --fullmode can help out. 4. As for KDevelop pulling in the old desktop environment, that’s probably solved by switching away from quarterly.

8 thoughts on “HowTo Modern (2018) KDE on FreeBSD

  1. KDE isn’t the name of any software. Could someone posting on Planet KDE please, after 9 years since the rebranding, finally get the memo? There isn’t and never was “KDE5” either.

    • kde5 is more or less like a metapackage in Linux. It brings in Plasma, the KDE frameworks and the KDE Applications collection. Users who want each of those separately can still install them separately, but practical experience shows most of them just want KDE :-).

  2. root@fbsd:~ # pkg install sddm kde5
    Updating FreeBSD repository catalogue…
    FreeBSD repository is up to date.
    All repositories are up to date.
    pkg: No packages available to install matching ‘kde5’ have been found in the repositories

  3. Maybe it will work from pkg after 11.2 drops 🙂 kde5 is not in 11.1 pkg list though, and kdevelop tries to install kde4 as a whole de 🙁

  4. For those experiencing problems finding KDE 5 in the pkg repository, I had to modify the /etc/pkg/FreeBSD.conf file.

    Change:
    url: “pkg+http://pkg.FreeBSD.org/${ABI}/quarterly”,

    to:
    url: “pkg+http://pkg.FreeBSD.org/${ABI}/latest”,

    After a “pkg update”. you can run “pkg install kde5”. By default, FreeBSD 11 seems to only update packages quarterly. Adriaan, could you please add this to your guide here?

  5. Is it possible to disable powerdevil? It keeps crashing every login and it’s really annoying.

    • Doesn’t even seem to be enabled / installed here, so I’m not sure where you got it from. I’d suggest “just uninstall it”.