Azure-kinect-sensor-sdk: Using apt to install k4a package in a non-interactive environment fails

Created on 23 Apr 2020  路  2Comments  路  Source: microsoft/Azure-Kinect-Sensor-SDK

Describe the bug
If you attempt to install the Debian K4A package using apt (or dpkg) the install we fail by default. This is due to the interactive EULA which users need to accept (due to guidance from Microsoft) to install the Debian package.

A common scenario for this would be attempting to use apt to install libk4a1.4 in a Docker container.

To Reproduce

  1. Create a Dockerfile with a step to run apt-get install libk4a1.4
  2. Build that docker image
  3. See error -->Sub-process /usr/bin/dpkg returned an error code (1)

Desktop (please complete the following information):

  • OS with Version: Ubuntu 18.04
ARM Bug Linux Triage Approved

Most helpful comment

We are looking at adding support for allowing users to set an environmental variable to also skip this.

This would look something like

ACCEPT_EULA=Y apt install libk4a1.5

Note: You'd have to be root to get this to work as I don't think sudo would pass the proper environmental variables.

All 2 comments

This is a known issue due to the EULA we are required to present to users. We have a work around to this issue.

The EULA acceptance is done using Debconf. You can manually set entries in the debconf database to accept the EULA before installing the debian package.

The steps to do this are as follows (please substitute in the correct version of the package):

1) Set the environmental variable DEBIAN_FRONTEND to noninteractive. If you are in a Dockerfile you can do this with the ARG command.

Docker ARG DEBIAN_FRONTEND=noninteractive

This tells dpkg and debconf that you are in a non-interactive environment.

2) Manually set the hash of the accepted EULA in the debconf database.

bash echo 'libk4a1.4 libk4a1.4/accepted-eula-hash string 0f5d5c5de396e4fee4c0753a21fee0c1ed726cf0316204edda484f08cb266d76' | sudo debconf-set-selections

NOTE: That hash may change if the EULA ever changes.

3) Manually set that the user has accepted the EULA.

bash echo 'libk4a1.4 libk4a1.4/accept-eula boolean true' | sudo debconf-set-selections

4) Install the libk4a package. In the stdout from the install process you should see

License has already been accepted

We are looking at adding support for allowing users to set an environmental variable to also skip this.

This would look something like

ACCEPT_EULA=Y apt install libk4a1.5

Note: You'd have to be root to get this to work as I don't think sudo would pass the proper environmental variables.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

UnaNancyOwen picture UnaNancyOwen  路  3Comments

AdrienPfeufferCarmenta picture AdrienPfeufferCarmenta  路  4Comments

RenderHeadsMrT picture RenderHeadsMrT  路  3Comments

Elenaegr picture Elenaegr  路  3Comments

virtusense-trisha picture virtusense-trisha  路  4Comments