BSD - howinfo/howinfo GitHub Wiki

Package management and BSD XFCE install info

BSD Week 18-26 of April 2027

https://forum.lunduke.com/t/bsd-week-begins/4118

Differences between OpenBSD, NetBSD and FreeBSD

For OpenBSD/NetBSD/FreeBSD, they have differences in commands and config files how to setup XFCE, and different login screens. I have not yet figured out how to have graphical login screen at NetBSD, so I need to login at text mode, and then write startx

CLI args

"$@" adds all cli arguments

$1 is first argument

$2 is 2nd argument

Killing VirtualBox that is stuck

./killvm.sh

killall VirtualBox VirtualBoxVM

BSDNews

OpenBSD

Installing OpenBSD:

  1. Edit file: nano update.sh
  2. Save and Exit: Ctrl-o Enter Ctrl-x Enter
  3. Change to executeable: chmod +x *.sh
  4. Update: ./update.sh

Package management: https://www.openbsd.org/faq/faq15.html

Before these, change to root:

su

./update.sh

pkg_add -u

./release-info.sh

uname -a

./release-upgrade.sh as root https://www.openbsd.org/faq/upgrade73.html

sysupgrade

./search.sh

pkg_info -Q "$@"

./install.sh

pkg_add "$@"

./uninstall.sh

pkg_delete "$@"

./shutdown.sh

halt -p

./reboot.sh

reboot

Godot 4:

pkg_add godot4-editor

Godot 3:

pkg_add godot-tools

OpenBSD XFCE

Install XFCE packages etc

su

pkg_add xfce xfce-extras consolekit2 polkit-gnome nano git tcl tk wget curl

D-Bus messaging between desktops:

rcctl enable messagebus

rcctl start messagebus

Power management:

rcctl enable apmd

rcctl start apmd

Graphical login:

rcctl enable xenodm

rcctl start xenodm

Add here to $USER your normal username to staff group, for performance:

usermod -G staff $USER

If you need audio, and there is no audio, add yourself to _audio group:

usermod -G _audio $USER

Update GPU firmware:

fw_update

exit

Graphical login and language, as normal user, edit these

  1. nano ~/.profile
export LANG=fi_FI.UTF-8
export LC_CTYPE="fi_FI.UTF-8"
export LC_ALL=""
  1. nano ~/.xsession
export LANG=fi_FI.UTF-8
export LC_CTYPE="fi_FI.UTF-8"
exec startxfce4

Reboot:

su

reboot

OpenBSD KDE: Not tried yet, does it work?

Heavyweight KDE: https://rsadowski.de/posts/2024-01-09-openbsd-kde/

pkg_add kde kde_plasma kde_plasma_extra

NetBSD

https://netbsd.org

NetBSD Install Tips

  • Passwords needs to be at least 7 characters long, install fails setting shorter password
  • Install from .iso and install packages from CDROM, because CDN does not work, below is changing to packages mirror
  • When installing, configure network, etc, but do not run "install" to update packages from not-working CDN, it gets stuck
  • Add xdm, ssh, etc. If you have network connection, add ntpdate to set correct date.
  • Add user account
  • Use default partitions
  • By default, vi is installed. Nano is not, it can be installed later.
  • Use default sh shell. Changing it or adding path to prompt is too fragile.

NetBSD Editing with nano

  1. Edit file: nano update.sh
  2. Save and Exit: Ctrl-o Enter Ctrl-x Enter
  3. Change to executeable: chmod +x *.sh
  4. Update: ./update.sh

NetBSD Package Management

Package management: https://www.netbsd.org/docs/pkgsrc/using.html

https://www.netbsd.org/mirrors/

Before these, change to root, and change to some working package mirror, like this.

Adding package mirror while installing worked for pkgin, but after installing it had not saved package mirror, and pkg_add pkgin falsely said pkgin is not installed when pkgin upgrade did work anyway.

But I did not find working pkgsrc mirror at 2026-04-18.

su

echo "http://ftp.fr.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/10.1/All/" > /usr/pkg/etc/pkgin/repositories.conf

pkg_add pkgin

pkgin upgrade

Install some packages:

pkgin install nano firefox firefox-l10n \
  findutils git tcl tk fpc go \
  zip unzip p7zip curl wget

./release-info.sh

uname -a

NetBSD: Upgrading release, rarely needed

./release-upgrade.sh 10.1 after ./install.sh sysupgrade https://www.netbsd.org/docs/guide/en/chap-upgrading.html

sysupgrade auto https://cdn.NetBSD.org/pub/NetBSD/NetBSD-$1/amd64

NetBSD Search Script

./search.sh

pkgin search "$@"

NetBSD Install Script

./install.sh

pkgin install "$@"

NetBSD Uninstall Script

./uninstall.sh

pkg_delete "$@"

NetBSD Shutdown Script

./shutdown.sh

/sbin/shutdown -p now

NetBSD Reboot Script

./reboot.sh

/sbin/reboot now

NetBSD Installing locate for finding files

Here, it is optional to install nano or bash, if you would like to use them:

pkgin install findutils nano
updatedb
locate somefilename

File locations:

/usr/pkg/gnu/bin/updatedb
/usr/pkg/gnu/bin/locate
/usr/pkg/bin/nano

NetBSD Path

Showing current paths:

echo $PATH

If some path is missing, add it to .shrc)

export PATH=$PATH:/usr/pkg/gnu/bin:/usr/pkg/bin

After successfull install finally, at VirtualBox, I made Linked Clone of NetBSD to share original disk space, so that I can try installing lightweight XFCE or heavyweight KDE at different Linked Clone VMs.

NetBSD Install XFCE

This is lightweight, uses small amount of disk space.

VirtualBox Display Settings:

  • Video Memory: 128 MB
  • Graphics Controller: VMSVGA
su

pkgin install xfce4 xfce4-extras

cp /usr/pkg/share/examples/rc.d/dbus /etc/rc.d/

Check that at /etc/rc.conf is:

#xdm=YES
dbus=YES

Then:

/etc/rc.d/dbus start

exit

echo "exec startxfce4" > ~/.xinitrc

startx

Trying to make automatic login to GUI desktop is too fragile, because xdm enabled it does not go XFCE but goes to OpenBox. It's better to use CLI to login and then startx.

NetBSD XFCE Change Language

Add to /etc/profile, normal user .shrc and .bashrc, and reboot:

export LANG=fi_FI.UTF-8
export LC_ALL=fi_FI.UTF-8

If it does not work, try changing XFCE desktop keyboard settings etc.

NetBSD Install KDE, this does not work

NOTE: This does not work, there is no package plasma-desktop.

This is heavyweight, takes a lot of disk space, CPU and RAM.

This also requires dbus.

Search for KDE version available and install it:

pkgin search kde | grep meta

pkgin install kde-20240828 slim

Add comment out at /etc/rc.conf:

#xdm=YES

Add to /etc/rc.conf:

rpcbind=YES
dbus=YES
hal=YES
slim=YES

Check that these are at /etc/fstab:

procfs  /proc      procfs  rw,linux      0 0
ptyfs   /dev/pts   ptyfs   rw            0 0

Setup dbus:

cp /usr/pkg/share/examples/rc.d/dbus /etc/rc.d/

echo "dbus=YES" >> /etc/rc.conf

/etc/rc.d/dbus start

Change to normal non-root user:

exit

This startx is not working, screen flashes, VirtualBox is setup to graphics acceleration and 256 MB GPU RAM, or try VBoxVGA or VMSVGA:

echo "exec ck-launch-session startplasma-x11" > ~/.xinitrc

Trying this instead at start.sh:

startx /usr/pkg/bin/startplasma-x11

NetBSD Audio

If you need sound, install pulseaudio or pipewire

pkgin install pulseaudio
# Or:
pkgin install pipewire

Check your user belongs to required audio etc groups, adding your username here:

a) Admin:

usermod -G wheel,audio,operator $USER

b) Admin, if you install at bare metal and need GPU hardware acceleration (DRM/DRI):

usermod -G wheel,audio,operator,video $USER

c) Normal user:

usermod -G audio $USER

If still no sound, check ownership of /dev/audio:

ls -l /dev/audio* /dev/mixer* /dev/sound*

It should look like this:

crw-rw----  1 root  audio  ... /dev/audio0

But if it looks like this:

crw-r-----

Add rw rights like this:

su

chmod g+rw /dev/audio* /dev/mixer* /dev/sound*

If rights are reset to default after reboot, and there is /dev/MAKEDEV.conf, you can edit it to make sure rights are set at boot.

Usually it's anyway enough to check, who owns devices. If owner is not audio group, you can change it:

chown root:audio /dev/audio* /dev/mixer* /dev/sound*

You can check can user access audio without root by using audioplay command:

audioplay something.wav

NetBSD Firefox

pkgin install firefox firefox-l10n

NetBSD git and ssh

NetBSD version of git command has certificate errors. To be able to clone git repos, with Firefox download working git command from https://cosmo.zip/pub/cosmos/zip/git.zip , unzip, and add those files to ~/bin . This is part of cross-platform cosmos https://justine.lol/cosmo3/

Also add your ssh keys to ~.ssh

NetBSD Free RAM

free.sh , showing amount of free RAM:

cat /proc/meminfo

FreeBSD

https://freebsd.org

FreeBSD XFCE

For VirtualBox, there is wiki page https://wiki.freebsd.org/VirtualBox

At VirtualBox 7.2, with below info, VirtualBox additions work with dynamic resolution change when resizing VirtualBox FreeBSD window.

  1. Install from CD .iso , display 128 MB VBoxSVGA, no 3D acceleration (ignore warning).

  2. Login as root.

  3. Give su - rights to your normal user, and video for desktop rights, replace $USER here:

pw groupmod wheel -m $USER

pw groupmod video -m $USER
  1. Install some packages:
pkg install sudo nano curl wget git zip unzip
  1. If bare metal GPU Intel or AMD:
pkg install drm-kmod
  1. with sysrc command: (adds to /etc/rc.conf)
# a) Intel
sysrc kld_list+=i915kms

# b) AMD
sysrc kld_list+=amdgpu
  1. Install xorg, xfce and login screen slim:
pkg install xorg xfce slim
  1. with sysrc command, add these (adds to /etc/rc.conf):
sysrc dbus_enable="YES"

sysrc slim_enable="YES"
  1. If VirtualBox, search for related additions:
pkg search virtualbox

9.1. For VirtualBox 7.2, install these, these also adds vboxusers group:

pkg install virtualbox-ose-additions-72

9.2. Change here your normal username to $USER, to add to vboxusers group:

pw groupmod vboxusers -m $USER

9.3. Add with sysrc command (adds to /etc/rc.conf):

sysrc vboxguest_enable="YES"
sysrc vboxservice_enable="YES"

9.4. For mouse and keyboard at VirtualBox:

nano /usr/local/etc/X11/xorg.conf.d/20-vbox.conf

Section "Device"
    Identifier "Card0"
    Driver     "vboxvideo"
EndSection

9.5. If change language and VirtualBox:

nano /usr/local/etc/X11/xorg.conf.d/90-keyboard.conf

There at 90-keyboard.conf add:

Section "InputClass"
    Identifier "KeyboardDefaults"
    MatchIsKeyboard "on"
    Option "XkbLayout" "fi"
EndSection
  1. If change language of whole system, also login screen, nano /etc/login.conf , add to default section:
default:\
    :lang=fi_FI.UTF-8:\
    :charset=UTF-8:\

Update language change to database:

cap_mkdb /etc/login.conf
  1. Login as normal user
exit

# login:
# password: 
  1. nano ~/.xinitrc , add exec line. If change language, add those export lines too.
export LANG=fi_FI.UTF-8
export LC_ALL=fi_FI.UTF-8
export LANGUAGE=fi_FI.UTF-8
exec startxfce4
  1. Reboot
su -

reboot
  1. If you changed language, it may ask for renamin user directories, like Desktop, Downloads, etc. You can answer "Yes", so you get full translated experience.

  2. At XFCE desktop keyboard settings, change language, if needed.

  3. At XFCE desktop terminal, add more software:

Firefox:

su -

pkg search firefox | more

pkg install firefox

Lazarus IDE:

pkg install lazarus-gtk2 fpc-source gdb

# FPC source at directory:
#   /usr/local/share/fpc-source-3.2.3
# gdb at directory:
#   /usr/local/bin/gdb151
# IDE layout: Modern IDE, Modern Form Editor

tcl tk 8.6:

pkg install tcl86 tk86

# search where it is
pkg info -l tk86 | grep bin/

/usr/local/bin/wish8.6 something.tcl

# make wish command working:
ln -s /usr/local/bin/wish8.6 /usr/local/bin/wish

tcl tk 9.0:

pkg install tcl90 tk90

locate:

pkg install plocate

# This did run:
updatedb
# But required to run this:
/etc/periodic/weekly/310.locate

locate something

Pacman

Arch Linux, HyperbolaBSD, etc

  1. Edit file: nano update.sh
  2. Save and Exit: Ctrl-o Enter Ctrl-x Enter
  3. Change to executeable: chmod +x *.sh
  4. Update: ./update.sh

Package management: https://www.openbsd.org/faq/faq15.html

Before these, change to root:

su

./update.sh

pacman -Syuu

./search.sh

pacman -Ss "$@"

./install.sh

pacman -S "$@"

./uninstall.sh

pacman -R "$@"

Haiku

./update.sh

pkgman refresh
pkgman full-sync
pkgman update

./install.sh

pkgman install "$@"

./uninstall.sh

pkgman uninstall "$@"

./search.sh

pkgman search "$@"

./listrepos.sh

pkgman list-repos

./addrepo.sh

## Add repo URL
pkgman add-repo "$@"

./resolvedeps.sh

# packagename repository-url
pkgman resolve-dependencies $1 $2

FreeDOS

Debuty

AlpineLinux

./update.sh

apk upgrade

./install.sh

apk add "$@"

./uninstall.sh

apk del "$@"

./dev.sh (compiler packages, like "sudo apt install build-essential")

apk add alpine-sdk

Ubuntu

https://ubuntu.com

  1. Edit file: nano update.sh
  2. Save and Exit: Ctrl-o Enter Ctrl-x Enter
  3. Change to executeable: chmod +x *.sh
  4. Update: ./update.sh

./more-package-managers.sh

sudo apt -y install flatpak gnome-software-plugin-flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
sudo apt -y install snapd
sudo reboot

./update.sh

sudo apt update
sudo apt -y dist-upgrade
sudo snap refresh
flatpak update

./release-info.sh

uname -a

cat /etc/issue

./release-upgrade.sh as normal user (not root)

do-release-upgrade

./search.sh

sudo apt-cache search "$@"

./clean.sh

sudo apt clean
sudo apt -y autoclean
sudo apt -y autoremove

./install.sh

sudo apt -y install "$@"

./uninstall.sh

sudo apt remove "$@"

./uninstall-all.sh

# more dangerous, all configs and data:
sudo apt --purge remove "$@"

shutdown.sh

sudo shutdown --poweroff now

reboot.sh

sudo shutdown --reboot now

Fedora

https://fedoraproject.org

./more-software.sh , change first line -fi to your language. Voikko is Finnish spellchecking, not for other languages.

sudo dnf install libreoffice-langpack-fi libreoffice-help-fi libreoffice-voikko \
libreoffice libreoffice-postgresql libreoffice-pdfimport libreoffice-writer2latex \
libreoffice-writer2xhtml libreoffice-filters \
lazarus zip unzip p7zip gimp inkscape keepassxc haxe zig \
gambas3 godot golang virt-manager qemu remmina

./update.sh

sudo dnf upgrade --refresh

./release-info.sh

cat /etc/fedora-release

./release-upgrade.sh 38 after above ./update.sh and ./reboot.sh https://docs.fedoraproject.org/en-US/quick-docs/upgrading-fedora-offline/

sudo dnf install dnf-plugin-system-upgrade

sudo dnf system-upgrade download --releasever="$@"

./search.sh

sudo dnf search "$@"

./clean.sh

sudo dnf clean all

./install.sh

sudo dnf -y install "$@"

./uninstall.sh

sudo dnf remove "$@"

./uninstall-all.sh

# more dangerous, all related packages, configs and data:
sudo dnf erase "$@"

./shutdown.sh

sudo shutdown --h now

./reboot.sh

sudo reboot