How to run R on a server without X11, and avoid broken dependencies

Use the virtual framebuffer X11 server — we do the same to build packages requiring X11 for R builds in headless chroots. Taking e.g. pars of the Build-Depends from rggobi:

xvfb xauth xfonts-base

After installing these you can use the xvfb-run command. If you start R via e.g.

xvfb-run R --no-save

you should now be able to use routines and commands requiring X11 as e.g. some of the plotting devices, or the tcl/tk initialization which also insists on having X11.

The same trick is useful for web servers.

Leave a Comment