bash - 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.
- Is there a way to resolve the above error so I can use
ACCEPT_EULA=Y
, or - alternatively is there a simple way to enter the
Y
response for the EULA automatically so the end user never needs to take any action?
Thank you in advance.
解决方案
您似乎有权运行任意命令,但不能修改环境。
简单的解决方法是将环境更改移交给命令:
sudo env ACCEPT_EULA=Y apt-get install msodbcsql17
推荐阅读
- mysql - 如何在sql中实现这一点?
- javascript - JavaScript - 改变对象字面量的值
- sharepoint - 使用 Power 自动将 PDF 文件从 Sharepoint 文件夹复制到 FTP
- javascript - 如何在反应中从地图中获取第一个值
- javascript - React 光滑的轮播项目变得模糊
- azure - Azure B2C:使用自定义声明查询 AAD?
- security - 金融科技公司所需的认证
- swift - 如何使用 IPad 从 IPad 上的 View Image 获取点云(RGB,设备上的 2D 坐标,3D 点的坐标)?
- python - 防止exec内部python中的无限循环
- angular11 - 无法在 HTML (Angular) 上使用