4

I need to set environment variables for unattended-upgrades:

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 needs "ACCEPT_EULA=Y" beeing set for the user who tries to install msodbcsql17. I already added the line to "/etc/environment" which works fine for shell users but not for unattended-upgrades.

I've not been successful browsing the docs for a solution. I could inject ENV using the Systemd service file but it would be more clean if unattended-upgrades allows to specify them somewhere.

Any ideas?

Kevin
  • 51
  • 1
  • 1
    Debian packages aren’t supposed to rely on environment variables, so it’s unlikely the package maintenance tools would provide a nice way to handle this situation (and I don’t know of one). Ironically, the `preinst` sets debconf up (debconf being the right tool here, at least following Debian practices), but clears existing values if the environment variable isn’t set to “y” or “Y”... – Stephen Kitt Oct 28 '19 at 08:32
  • 1
    Using a systemd drop-in for apt-daily-upgrade.service seems to work. According to your comment, that seems to be the only solution available. – Kevin Oct 28 '19 at 08:42
  • 3
    I imagine there are other ways of going about it, but yes, that does seem like one of the nicer approaches (although modifying a system-wide service for a single package is unfortunate). It would be great if you could write up your solution as an answer (in the “Your Answer” box below)! – Stephen Kitt Oct 28 '19 at 08:45

0 Answers0