Skip to content

Reality Industries LLC

  • Reality Industries
    • Manifold Plex
    • Login
  • Tech Stuff
    • Tech News
    • Linux and FreeBSD
      • Linux Cheatsheet
      • FreeBSD Cheat Sheet.
    • Recipes and Howtos
      • Add Debian box to Active Directory
      • Configure automatic mounting of SMB shares using CIFS and fstab on Debian 12
      • Install SQL Server 2022 on Debian 12
    • Windows
    • The Jargon File
  • Other Stuff
    • Stuff going on worldwide
    • Stuff going on in Canada
    • Stuff going on in the Maritimes
    • Funny Stuff
    • Various Services and Stuff
    • Interesting Stuff
  • About
    • About Me
    • Privacy Policy
    • Reality Systems
    • Contact Us
  • Toggle search form

Install SQL Server 2022 on Debian 12

1. Install Debian 12.

2. Ok, lets get to it. 1st, lets add the contrib and non-free sources to apt, just in case.

jake@molly:~$ sudo nano /etc/apt/sources.list

Add contrib non-free to the end of all the repos:

GNU nano 7.2 /etc/apt/sources.list 
#deb cdrom:[Debian GNU/Linux 12.5.0 _Bookworm_ - Official amd64 NETINST with firmware 20240210-11:27]/ bookworm contrib main non-free-firmware

deb http://deb.debian.org/debian/ bookworm main non-free-firmware contrib non-free
deb-src http://deb.debian.org/debian/ bookworm main non-free-firmware contrib non-free

deb http://security.debian.org/debian-security bookworm-security main non-free-firmware contrib non-free
deb-src http://security.debian.org/debian-security bookworm-security main non-free-firmware contrib non-free

# bookworm-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
deb http://deb.debian.org/debian/ bookworm-updates main non-free-firmware contrib non-free
deb-src http://deb.debian.org/debian/ bookworm-updates main non-free-firmware contrib non-free

Update the system, then, we install some prereqs:

jake@molly:~$ sudo apt install gnupg2 apt-transport-https wget curl 
Reading package lists... 
Done Building depen...

…ugh…

Setting up curl (7.88.1-10+deb12u7) ...
Processing triggers for man-db (2.11.2-2) ...
Processing triggers for libc-bin (2.36-9+deb12u8) ...
jake@molly:~$

3. Download the MS GPG key and install it. It will add a repo to apt and will allow you to install several versions of SQL Server, 2017, 19, and 22.

jake@molly:~$wget -q -O- https://packages.microsoft.com/keys/microsoft.asc | \gpg --dearmor | sudo tee /usr/share/keyrings/microsoft.gpg > /dev/null 2>&1
jake@molly:~$

Add the repos to apt.

jake@molly:~$ echo "deb [signed-by=/usr/share/keyrings/microsoft.gpg arch=amd64,armhf,arm64] https://packages.microsoft.com/ubuntu/22.04/mssql-server-2022 jammy main" | sudo tee /etc/apt/sources.list.d/mssql-server-2022.list
deb [signed-by=/usr/share/keyrings/microsoft.gpg arch=amd64,armhf,arm64] https://packages.microsoft.com/ubuntu/22.04/mssql-server-2022 jammy main
jake@molly:~$

This sets up the official MS repo for SQL Server. Save it, and run apt update. Only the best for us! It will complain about a deprecated method of storing the key. Good ol MS. It’s only a warning, so we are good to go.

jake@molly:~$ sudo apt update
Get:1 https://packages.microsoft.com/ubuntu/22.04/mssql-server-2022 jammy InRelease [3,624 B]
Get:2 https://packages.microsoft.com/ubuntu/22.04/mssql-server-2022 jammy/main amd64 Packages [3,597 B]
Hit:3 http://security.debian.org/debian-security bookworm-security InRelease 
Hit:4 http://deb.debian.org/debian bookworm InRelease 
Hit:5 http://deb.debian.org/debian bookworm-updates InRelease
Fetched 7,221 B in 10s (687 B/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
jake@molly:~$

Finally, we can install SQL Server. It’s been a long road.

jake@molly:~$ sudo apt install mssql-server
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
gawk gdb libatomic1 libbabeltrace1 libboost-regex1.74.0 libc++1 libc++1-14 libc++abi1-14 libc6-dbg libdebuginfod-common libdebuginfod1 libipt2
libmpfr6 libnuma1 libsigsegv2 libsource-highlight-common libsource-highlight4v5 libunwind-14
Suggested packages:
gawk-doc gdb-doc gdbserver clang
The following NEW packages will be installed:
gawk gdb libatomic1 libbabeltrace1 libboost-regex1.74.0 libc++1 libc++1-14 libc++abi1-14 libc6-dbg libdebuginfod-common libdebuginfod1 libipt2
libmpfr6 libnuma1 libsigsegv2 libsource-highlight-common libsource-highlight4v5 libunwind-14 mssql-server
0 upgraded, 19 newly installed, 0 to remove and 0 not upgraded.
Need to get 289 MB of archives.
After this operation, 1,340 MB of additional disk space will be used.
Do you want to continue? [Y/n]y
Get:2 http://deb.debian.org/debian bookworm/main amd64 libmpfr6 amd64 4.2.0-1 [701 kB]
Get:3 http://deb.debian.org/debian bookworm/main amd64 libsigsegv2 amd64 2.14-1 [37.2 kB]
Get:4 http://deb.debian.org/debian bookworm/main amd64 gawk amd64 1:5.2.1-2 [673 kB] 
Get:5 http://deb.debian.org/debian bookworm/main amd64 libdebuginfod-common all 0.188-2.1 [21.5 kB]
Get:6 http://deb.debian.org/debian bookworm/main amd64 libbabeltrace1 amd64 1.5.11-1+b2 [172 kB] 
Get:7 http://deb.debian.org/debian bookworm/main amd64 libdebuginfod1 amd64 0.188-2.1 [27.3 kB] 
Get:8 http://deb.debian.org/debian bookworm/main amd64 libipt2 amd64 2.0.5-1 [43.9 kB] 
Get:9 http://deb.debian.org/debian bookworm/main amd64 libsource-highlight-common all 3.1.9-4.2 [77.4 kB]
Get:10 http://deb.debian.org/debian bookworm/main amd64 libboost-regex1.74.0 amd64 1.74.0+ds1-21 [487 kB] 
Get:11 http://deb.debian.org/debian bookworm/main amd64 libsource-highlight4v5 amd64 3.1.9-4.2+b3 [257 kB] 
Get:12 http://deb.debian.org/debian bookworm/main amd64 gdb amd64 13.1-3 [3,962 kB] 
Get:13 http://deb.debian.org/debian bookworm/main amd64 libatomic1 amd64 12.2.0-14 [9,328 B] 
Get:14 http://deb.debian.org/debian bookworm/main amd64 libunwind-14 amd64 1:14.0.6-12 [44.4 kB] 
Get:15 http://deb.debian.org/debian bookworm/main amd64 libc++abi1-14 amd64 1:14.0.6-12 [87.0 kB] 
Get:16 http://deb.debian.org/debian bookworm/main amd64 libc++1-14 amd64 1:14.0.6-12 [288 kB] 
Get:17 http://deb.debian.org/debian bookworm/main amd64 libc++1 amd64 1:14.0-55.7~deb12u1 [4,912 B]
Get:18 http://deb.debian.org/debian bookworm/main amd64 libc6-dbg amd64 2.36-9+deb12u8 [7,376 kB] 
Get:19 http://deb.debian.org/debian bookworm/main amd64 libnuma1 amd64 2.0.16-1 [21.0 kB] 
Get:1 https://packages.microsoft.com/ubuntu/22.04/mssql-server-2022 jammy/main amd64 mssql-server amd64 16.0.4135.4-3 [275 MB]
Fetched 289 MB in 5min 11s (927 kB/s) 
Preconfiguring packages ...
Selecting previously unselected package libmpfr6:amd64.
(Reading database ... 35961 files and directories currently installed.)
Preparing to unpack .../libmpfr6_4.2.0-1_amd64.deb ...
Unpacking libmpfr6:amd64 (4.2.0-1) ...
Selecting previously unselected package libsigsegv2:amd64.
Preparing to unpack .../libsigsegv2_2.14-1_amd64.deb ...
Unpacking libsigsegv2:amd64 (2.14-1) ...
Setting up libmpfr6:amd64 (4.2.0-1) ...
Setting up libsigsegv2:amd64 (2.14-1) ...
Selecting previously unselected package gawk.
(Reading database ... 35981 files and directories currently installed.)
Preparing to unpack .../00-gawk_1%3a5.2.1-2_amd64.deb ...
Unpacking gawk (1:5.2.1-2) ...
Selecting previously unselected package libdebuginfod-common.
Preparing to unpack .../01-libdebuginfod-common_0.188-2.1_all.deb ...
Unpacking libdebuginfod-common (0.188-2.1) ...
Selecting previously unselected package libbabeltrace1:amd64.
Preparing to unpack .../02-libbabeltrace1_1.5.11-1+b2_amd64.deb ...
Unpacking libbabeltrace1:amd64 (1.5.11-1+b2) ...
Selecting previously unselected package libdebuginfod1:amd64.
Preparing to unpack .../03-libdebuginfod1_0.188-2.1_amd64.deb ...
Unpacking libdebuginfod1:amd64 (0.188-2.1) ...
Selecting previously unselected package libipt2.
Preparing to unpack .../04-libipt2_2.0.5-1_amd64.deb ...
Unpacking libipt2 (2.0.5-1) ...
Selecting previously unselected package libsource-highlight-common.
Preparing to unpack .../05-libsource-highlight-common_3.1.9-4.2_all.deb ...
Unpacking libsource-highlight-common (3.1.9-4.2) ...
Selecting previously unselected package libboost-regex1.74.0:amd64.
Preparing to unpack .../06-libboost-regex1.74.0_1.74.0+ds1-21_amd64.deb ...
Unpacking libboost-regex1.74.0:amd64 (1.74.0+ds1-21) ...
Selecting previously unselected package libsource-highlight4v5:amd64.
Preparing to unpack .../07-libsource-highlight4v5_3.1.9-4.2+b3_amd64.deb ...
Unpacking libsource-highlight4v5:amd64 (3.1.9-4.2+b3) ...
Selecting previously unselected package gdb.
Preparing to unpack .../08-gdb_13.1-3_amd64.deb ...
Unpacking gdb (13.1-3) ...
Selecting previously unselected package libatomic1:amd64.
Preparing to unpack .../09-libatomic1_12.2.0-14_amd64.deb ...
Unpacking libatomic1:amd64 (12.2.0-14) ...
Selecting previously unselected package libunwind-14:amd64.
Preparing to unpack .../10-libunwind-14_1%3a14.0.6-12_amd64.deb ...
Unpacking libunwind-14:amd64 (1:14.0.6-12) ...
Selecting previously unselected package libc++abi1-14:amd64.
Preparing to unpack .../11-libc++abi1-14_1%3a14.0.6-12_amd64.deb ...
Unpacking libc++abi1-14:amd64 (1:14.0.6-12) ...
Selecting previously unselected package libc++1-14:amd64.
Preparing to unpack .../12-libc++1-14_1%3a14.0.6-12_amd64.deb ...
Unpacking libc++1-14:amd64 (1:14.0.6-12) ...
Selecting previously unselected package libc++1:amd64.
Preparing to unpack .../13-libc++1_1%3a14.0-55.7~deb12u1_amd64.deb ...
Unpacking libc++1:amd64 (1:14.0-55.7~deb12u1) ...
Selecting previously unselected package libc6-dbg:amd64.
Preparing to unpack .../14-libc6-dbg_2.36-9+deb12u8_amd64.deb ...
Unpacking libc6-dbg:amd64 (2.36-9+deb12u8) ...
Selecting previously unselected package libnuma1:amd64.
Preparing to unpack .../15-libnuma1_2.0.16-1_amd64.deb ...
Unpacking libnuma1:amd64 (2.0.16-1) ...
Selecting previously unselected package mssql-server.
Preparing to unpack .../16-mssql-server_16.0.4135.4-3_amd64.deb ...
Unpacking mssql-server (16.0.4135.4-3) ...
Setting up libdebuginfod-common (0.188-2.1) ...
Setting up gawk (1:5.2.1-2) ...
Setting up libdebuginfod1:amd64 (0.188-2.1) ...
Setting up libsource-highlight-common (3.1.9-4.2) ...
Setting up libc6-dbg:amd64 (2.36-9+deb12u8) ...
Setting up libunwind-14:amd64 (1:14.0.6-12) ...
Setting up libc++abi1-14:amd64 (1:14.0.6-12) ...
Setting up libboost-regex1.74.0:amd64 (1.74.0+ds1-21) ...
Setting up libatomic1:amd64 (12.2.0-14) ...
Setting up libipt2 (2.0.5-1) ...
Setting up libbabeltrace1:amd64 (1.5.11-1+b2) ...
Setting up libnuma1:amd64 (2.0.16-1) ...
Setting up libsource-highlight4v5:amd64 (3.1.9-4.2+b3) ...
Setting up libc++1-14:amd64 (1:14.0.6-12) ...
Setting up gdb (13.1-3) ...
Setting up libc++1:amd64 (1:14.0-55.7~deb12u1) ...
Setting up mssql-server (16.0.4135.4-3) ...
Locale en_CA not supported. Using en_US.
+--------------------------------------------------------------+
Please run 'sudo /opt/mssql/bin/mssql-conf setup'
to complete the setup of Microsoft SQL Server
+--------------------------------------------------------------+

Processing triggers for man-db (2.11.2-2) ...
Processing triggers for libc-bin (2.36-9+deb12u8) ...
jake@molly:~$

so you then run that setup script:

jake@molly:~$ sudo /opt/mssql/bin/mssql-conf setup
[sudo] password for jake: 
Locale en_CA not supported. Using en_US.
Choose an edition of SQL Server:
1) Evaluation (free, no production use rights, 180-day limit)
2) Developer (free, no production use rights)
3) Express (free)
4) Web (PAID)
5) Standard (PAID)
6) Enterprise (PAID) - CPU core utilization restricted to 20 physical/40 hyperthreaded
7) Enterprise Core (PAID) - CPU core utilization up to Operating System Maximum
8) I bought a license through a retail sales channel and have a product key to enter.
9) Standard (Billed through Azure) - Use pay-as-you-go billing through Azure.
10) Enterprise Core (Billed through Azure) - Use pay-as-you-go billing through Azure.
Details about editions can be found at https://go.microsoft.com/fwlink/?LinkId=2109348

Use of PAID editions of this software requires separate licensing through a
Microsoft Volume Licensing program.
By choosing a PAID edition, you are verifying that you have the appropriate
number of licenses in place to install and run this software.
By choosing an edition billed Pay-As-You-Go through Azure, you are verifying 
that the server and SQL Server will be connected to Azure by installing the 
management agent and Azure extension for SQL Server.

Enter your edition(1-10): 3

The license terms for this product can be found in
/usr/share/doc/mssql-server or downloaded from: https://aka.ms/useterms

The privacy statement can be viewed at:
https://go.microsoft.com/fwlink/?LinkId=853010
Do you accept the license terms? [Yes/No]:yes

Choose the language for SQL Server:
(1) English
(2) Deutsch
(3) Español
(4) Français
(5) Italiano
(6) 日本語
(7) 한국어
(8) Português
(9) Руѝѝкий
(10) 中文 – 简体
(11) 中文 (繝体)
Enter Option 1-11: 1
Enter the SQL Server system administrator password: 
Confirm the SQL Server system administrator password: 
Configuring SQL Server...

The licensing PID was successfully processed. The new edition is [Express Edition].
ForceFlush is enabled for this instance. 
ForceFlush feature is enabled for log durability.
Created symlink /etc/systemd/system/multi-user.target.wants/mssql-server.service → /lib/systemd/system/mssql-server.service.
Setup has completed successfully. SQL Server is now starting.
jake@molly:~$

Check the status of the new install

jake@molly:~$ sudo systemctl status mssql-server
mssql-server.service - Microsoft SQL Server Database Engine
Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; preset: enabled)
Active: active (running) since Mon 2024-09-02 01:10:35 ADT; 4min 43s ago
Docs: https://docs.microsoft.com/en-us/sql/linux
Main PID: 14547 (sqlservr)
Tasks: 176
Memory: 767.8M
CPU: 12.645s
CGroup: /system.slice/mssql-server.service
├─14547 /opt/mssql/bin/sqlservr
└─14563 /opt/mssql/bin/sqlservr

Sep 02 01:10:41 molly sqlservr[14563]: [101B blob data]
Sep 02 01:10:41 molly sqlservr[14563]: [145B blob data]
Sep 02 01:10:41 molly sqlservr[14563]: [96B blob data]
Sep 02 01:10:41 molly sqlservr[14563]: [100B blob data]
Sep 02 01:10:41 molly sqlservr[14563]: [71B blob data]
Sep 02 01:10:41 molly sqlservr[14563]: [124B blob data]
Sep 02 01:10:41 molly sqlservr[14563]: [75B blob data]
Sep 02 01:10:45 molly sqlservr[14563]: [73B blob data]
Sep 02 01:10:45 molly sqlservr[14563]: [81B blob data]
Sep 02 01:11:50 molly sqlservr[14563]: [97B blob data]
jake@molly:~$

Yay! It’s done. Next step, integrate it with the domain.

Copyright 2025, all rights reserved, except for when they are not.