Skip to content

Build instructions for Ubuntu

Matt Maguire edited this page Sep 12, 2020 · 7 revisions

ee also the old version: https://redmine.darktable.org/projects/darktable/wiki/Building_darktable_22

Install prerequisites

The following code snippet is essentially equivalent to opening the "Software & Updates" program, selecting the "Source code" checkbox, hitting the "Update" button, running sudo apt-get build-dep darktable, and finally deselecting the "Source code" checkbox. All lines must be pasted at once into a terminal.

sed -e '/^#\sdeb-src /s/^# *//;t;d' "/etc/apt/sources.list" \
| sudo tee /etc/apt/sources.list.d/darktable-sources-tmp.list > /dev/null \
  && (    sudo apt-get update \
       && sudo apt-get build-dep darktable \
  ); sudo rm /etc/apt/sources.list.d/darktable-sources-tmp.list

Download and extract the latest release

Since perl is guaranteed to be installed, we can use it to download the latest release. The DT_VER environment variable is only for the purposes of these installation commands, so that the version can be adjusted in a single place.

DT_VER=3.0.0

perl -e "use LWP::Simple; getstore( \
  'https://github.com/darktable-org/darktable/releases/download/release-$DT_VER/darktable-$DT_VER.tar.xz', \
  '$HOME/Downloads/darktable-$DT_VER.tar.xz');"

cd ~/Downloads && tar xvf darktable-$DT_VER.tar.xz && rm darktable-$DT_VER.tar.xz && cd darktable-$DT_VER

Build

./build.sh

Install

sudo cmake --build "/home/user/Downloads/darktable-$DT_VER/build" --target install -- -j8

Create a link for the program shortcut and corresponding icon.

sudo ln -s /opt/darktable/share/applications/darktable.desktop /usr/share/applications/darktable.desktop
sudo ln -s /opt/darktable/share/icons/hicolor/scalable/apps/darktable.svg /usr/share/pixmaps/darktable.svg

Now you should be able to run Darktable from the program shortcut, or from the command line via

/opt/darktable/bin/darktable

In order to add darktable to the path so that the prefix /opt/darktable/bin/ is unnecessary, run

export PATH="/opt/darktable/bin:$PATH"

In order to set the prefix automatically, after your next login, run

echo export PATH=\"/opt/darktable/bin:\$PATH\" >> ~/.profile

Uninstall

To uninstall Darktable, it suffices to delete /opt/darktable-x.y.z and the links:

sudo rm -rf /opt/darktable-x.y.z
sudo rm /usr/share/applications/darktable.desktop
sudo rm /usr/share/pixmaps/darktable.svg

User-level configuration data is stored in ~/.config/darktable.

Note: this does not uninstall the prerequisites downloaded at the beginning.

Clone this wiki locally