I was trying to install mssql-tools (for sqlcmd and bcp) using apt-get install
as part of a Dockerfile, but the preinst script kept halting and prompting to accept the EULA.
Is there a way to automatically accept the license for this package?
The following steps install the SQL Server command-line tools: sqlcmd and bcp. Import the public repository GPG keys. Register the Ubuntu repository. Update the sources list and run the installation command with the unixODBC developer package.
To connect to a SQL Server Express instance, use the format machinename \SQLEXPRESS . If the SQL Server instance is listening on the default port, leave this set to 1433 . If your database administrator told you to specify a different port, replace 1433 with the new port number. Otherwise, delete 1433 .
Turns out you can set ACCEPT_EULA=Y
in the environment prior to the install command:
ACCEPT_EULA=y DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends mssql-tools unixodbc-dev
I discovered this by downloading the package .deb
file, untarring it and looking at the preinst
script which had this block:
check_eula_acceptance()
{
if [ "$ACCEPT_EULA" != "y" ] && [ "$ACCEPT_EULA" != "Y" ]; then
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With