首页 > 解决方案 > 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.

标签: bashenvironment-variablesinstallationdrivereula

解决方案


您似乎有权运行任意命令,但不能修改环境。

简单的解决方法是将环境更改移交给命令:

sudo env ACCEPT_EULA=Y apt-get install msodbcsql17

推荐阅读