Dave
Dave

Reputation: 490

Shell driver install with `ACCEPT_EULA=Y` error

As described here, I am trying to install the following driver in shell, using this code (modified from the original slightly):

curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/debian/8/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install msodbcsql17

But I get an error on the last command:

sudo: sorry, you are not allowed to set the following environment variables: ACCEPT_EULA

After searching, I can't seem to find this exact error anywhere else.

One solution is to run the last command without ACCEPT_EULA=Y as sudo apt-get install msodbcsql17. And then to enter Y at the prompt. This indeed works but I would like to run the above installation for other users without need of their input.

Thank you in advance.

Upvotes: 3

Views: 11600

Answers (3)

Frackalyzer
Frackalyzer

Reputation: 11

The ACCEPT_EULA=Y apt-get install -y msodbcsql17 command above did the trick for me as I was trying to set up msodbcsql17 via a Dockerfile.

Upvotes: 1

Jordan Simba
Jordan Simba

Reputation: 1216

I don't have enough rep to post a comment. But I was doing the same install for pyodbc inside a python:3 docker container. In the dockerfile the following command works:

ACCEPT_EULA=Y apt-get install -y msodbcsql17

(I was after this particular driver #17.)

Reading: https://github.com/microsoft/mssql-docker/blob/master/oss-drivers/pyodbc/Dockerfile can help see the environment set up from a base ubuntu (ubuntu:16.04) box.

Also check up on: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017 for microsoft first hand docs.

Upvotes: 3

that other guy
that other guy

Reputation: 123640

You appear to have access to run arbitrary commands, but not to modify the environment.

The simple workaround is to hand off environment changes to the command:

sudo env ACCEPT_EULA=Y apt-get install msodbcsql17

Upvotes: 9

Related Questions