Connect to Azure SQL Database through MS ODBC from Debian 10 on ARM64 architecture

Mahmoodi, Somayeh (Admin) 100 Reputation points
2024-12-31T18:32:43.0266667+00:00

Hi , I want to connect to my Azure SQL Database through MS ODBC from Debian 10 on ARM64 architecture. But I couldn't install msodbcsql (Microsoft ODBC Driver for SQL Server). I got this debian:~# ACCEPT_EULA=Y apt-get install -y msodbcsql18

Reading package lists... Done

Building dependency tree

Reading state information... Done

E: Unable to locate package msodbcsql18

I tried it with msodbcsql17 too. I also searched on the internet and on the microsoft pages and tried many ways, with no success.

In another try I got

curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 983 100 983 0 0 2069 0 --:--:-- --:--:-- --:--:-- 2069 OK root@iot2050-debian:~# curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 74 100 74 0 0 292 0 --:--:-- --:--:-- --:--:-- 293 root@iot2050-debian:~# apt-get update Hit:1 http://deb.debian.org/debian buster InRelease Hit:2 http://deb.debian.org/debian-security buster/updates InRelease Hit:3 https://packages.microsoft.com/debian/10/prod buster InRelease Hit:4 http://deb.debian.org/debian buster-updates InRelease Ign:5 http://deb.debian.org/debian buster-backports InRelease Get:6 http://deb.debian.org/debian bullseye InRelease [116 kB] Get:7 http://deb.debian.org/debian-security bullseye-security/updates InRelease [27.2 kB] Get:8 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB] Err:9 http://deb.debian.org/debian buster-backports Release 404 Not Found [IP: 151.101.126.132 80] Err:6 http://deb.debian.org/debian bullseye InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 NO_PUBKEY 605C66F00D6C9793 Get:10 http://deb.debian.org/debian-security bullseye-security/updates/main Sources [223 kB] Err:8 http://deb.debian.org/debian bullseye-updates InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 Reading package lists... Done E: The repository 'http://deb.debian.org/debian buster-backports Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: GPG error: http://deb.debian.org/debian bullseye InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 NO_PUBKEY 605C66F00D6C9793 E: The repository 'http://deb.debian.org/debian bullseye InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: GPG error: http://deb.debian.org/debian bullseye-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 E: The repository 'http://deb.debian.org/debian bullseye-updates InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. root@iot2050-debian:~# ACCEPT_EULA=Y apt-get install -y msodbcsql18 unixodbc-dev Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package msodbcsql18

I am new to Linux and would appreciate it if you help me in this regard.

Thank you

Somayeh

Azure SQL Database
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Alberto Morillo 35,401 Reputation points MVP Volunteer Moderator
    2024-12-31T19:25:36.0666667+00:00

    Please try the following commands o install the ODBC driver on Debian:

    #Debian 9-11
    curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
    
    #Download appropriate package for the OS version
    #Debian 10
    curl https://packages.microsoft.com/config/debian/10/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
    
    # Now update the package lists:
    sudo apt-get update
    
    sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
    
    # optional: for bcp and sqlcmd
    sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18
    echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
    source ~/.bashrc
    
    # optional: for unixODBC development headers
    sudo apt-get install -y unixodbc-dev
    
    # optional: kerberos library for debian-slim distributions
    sudo apt-get install -y libgssapi-krb5-2
    
    
    

    You can find more detailed information here.

    2 people found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.