Search code examples
openbsd

OpenBSD 6.7 how to install xbase


I am updating our integration test environments to OpenBSD 6.7 (from 6.5)

We use ansible to install all the packages on the target system (openbsd 6.7, Vagrant image https://app.vagrantup.com/generic/boxes/openbsd6/versions/3.0.6 )

With the above image, I cannot install java openjdk 11.

obsd-31# pkg_add -r jdk%11     
quirks-3.325 signed on 2020-05-27T12:56:02Z
jdk-11.0.7.10.2p0v0:lz4-1.9.2p0: ok
jdk-11.0.7.10.2p0v0:zstd-1.4.4p1: ok
jdk-11.0.7.10.2p0v0:jpeg-2.0.4p0v0: ok
jdk-11.0.7.10.2p0v0:tiff-4.1.0: ok
jdk-11.0.7.10.2p0v0:lcms2-2.9p0: ok
jdk-11.0.7.10.2p0v0:png-1.6.37: ok
jdk-11.0.7.10.2p0v0:giflib-5.1.6: ok
Can't install jdk-11.0.7.10.2p0v0 because of libraries
|library X11.17.0 not found
| not found anywhere
|library Xext.13.0 not found
| not found anywhere
|library Xi.12.1 not found
| not found anywhere
|library Xrender.6.0 not found
| not found anywhere
|library Xtst.11.0 not found
| not found anywhere
|library freetype.30.0 not found
| not found anywhere
Direct dependencies for jdk-11.0.7.10.2p0v0 resolve to png-1.6.37 libiconv-1.16p0 giflib-5.1.6 lcms2-2.9p0 jpeg-2.0.4p0v0
Full dependency tree is giflib-5.1.6 lz4-1.9.2p0 tiff-4.1.0 png-1.6.37 xz-5.2.5 jpeg-2.0.4p0v0 lcms2-2.9p0 zstd-1.4.4p1 libiconv-1.16p0
Couldn't install jdk-11.0.7.10.2p0v0

my guess is that xbase is not installed. However, I cannot figure out how to install xbase without rebooting into a bootable installer (because I need to do it via a shell command running from ansible)

Is there a way?


Solution

  • The generic OpenBSD Vagrant image you're using was created as a command line environment, so the X windows files were were excluded during the install process. There are lots of ways to add X windows to OpenBSD after installation, but the quickest method that comes to mind would be:

    sudo su -l
    curl -LO 'https://ftp.usa.openbsd.org/pub/OpenBSD/6.7/amd64/x{base,serv,font,share}67.tgz'
    tar xzf xbase67.tgz -C / 
    tar xzf xserv67.tgz -C / 
    tar xzf xfont67.tgz -C / 
    tar xzf xshare67.tgz -C / 
    rm -f xbase67.tgz xfont67.tgz xserv67.tgz xshare67.tgz
    ldconfig /usr/local/lib /usr/X11R6/lib
    

    If you would like to test for the presence of X windows on OpenBSD, try using the following shell snippet:

    if [ -d /usr/X11R6/bin/ ] && [ -f /usr/X11R6/bin/xinit ]; then
      echo "X windows has been installed."
    else
      echo "This is a command line only system."
    fi