So, my apt-get install
returns with E: Unable to locate package msodbcsql
(error code 100). I'm trying to access an SQL Server database with my system, and so I'm following Microsoft's instructions to install their driver for Linux.
I've tried specifying the package version: apt-get install -y msodbcsql17
and using the package for both Debian 8 and 9. I've tried to confirm the system version, as I'm actually building a Docker container from Debian:stretch-slim -> Python:3.6-slim
, and I'm leaning towards Debian 8, because the version number in other images is explicitly 9.
What could be my options trying to install the package? Other ways or steps of troubleshooting?
Many thanks in advance. I'm new to Linux in general, so any pointers are greatly appreciated!
Edit
According to bash: cat /etc/debian_version
my version is actually 9.5.
Best Answer
I followed the directions on the Microsoft documentation using python:3.6-slim and it appeared to install correctly with a few caveats
You'll need these packages to follow the directions
The Docker image doesn't have curl, apt-transport-https is required to use Microsoft's repo with https protocol, and gnupg2 is needed for the apt-key command
and it looks like this adds an /etc/odbcinst.ini that points at the driver
so you should be able to connect via the "ODBC Driver 17 for SQL Server" ODBC driver