I’m trying to install OpenJDK 9 as a build dependency in snapcraft. However, it fails with the following error:
Can not install 'openjdk-9-jdk' because it tries to overwrite file aready included in 'openjdk-9-jdk-headless'
Looks like this is due to this bug, and a workaround is therefore running:
sudo apt-get -o Dpkg::Options::="--force-overwrite" install openjdk-9-jdk
Is there any way to pass these options to apt / emulate this in a snapcraft file so openjdk can be installed?