![Debian - 无人值守升级:环境变量](https://linux22.com/image/162940/Debian%20-%20%E6%97%A0%E4%BA%BA%E5%80%BC%E5%AE%88%E5%8D%87%E7%BA%A7%EF%BC%9A%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F.png)
我需要为无人值守升级设置环境变量:
Packages that attempted to upgrade:
msodbcsql17
Package installation log:
Log started: 2019-10-28 06:51:03
apt-listchanges: Reading changelogs...
Preconfiguring packages ...
Preparing to unpack .../msodbcsql17_17.4.2.1-1_amd64.deb ...
ERROR: The EULA was not accepted. Installation aborted.
dpkg: error processing archive /var/cache/apt/archives/msodbcsql17_17.4.2.1-1_amd64.deb (--unpack):
new msodbcsql17 package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/msodbcsql17_17.4.2.1-1_amd64.deb
Log ended: 2019-10-28 06:51:05
Microsoft 需要为尝试安装 msodbcsql17 的用户设置“ACCEPT_EULA=Y”。我已经将该行添加到“/etc/environment”中,该行对于 shell 用户运行良好,但不适用于无人值守升级。
我没有成功浏览文档以找到解决方案。我可以使用 Systemd 服务文件注入 ENV,但如果无人值守升级允许在某处指定它们,它会更干净。
有任何想法吗?