If the SQL Server does not start and the error is "Unable to set persistent hive root", create a root path for the SQLPAL registry hive:
mkdir /var/opt/mssql/hk && chown mssql:mssql /var/opt/mssql/hk
| Git Clone URL: | https://aur.archlinux.org/mssql-server.git (read-only, click to copy) |
|---|---|
| Package Base: | mssql-server |
| Description: | Microsoft SQL Server for Linux |
| Upstream URL: | https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-overview?view=sql-server-ver16 |
| Licenses: | unknown |
| Submitter: | flash2k2 |
| Maintainer: | too |
| Last Packager: | too |
| Votes: | 31 |
| Popularity: | 0.015988 |
| First Submitted: | 2016-11-17 09:25 (UTC) |
| Last Updated: | 2025-10-20 16:15 (UTC) |
If the SQL Server does not start and the error is "Unable to set persistent hive root", create a root path for the SQLPAL registry hive:
mkdir /var/opt/mssql/hk && chown mssql:mssql /var/opt/mssql/hk
For anyone trying to use this package, here are the steps to install and setup the whole thing:
Step 1: Install this package, I like to use yay so the command would be:
$ yay -Syy mssql-server
Step 2: Execute the Microsoft SQL Server one time setup using mssql-conf and fill whatever it asks:
# Stuff it will ask you:
# - Select option 2 for development version
# - Accept terms and conditions
# - Select your language if prompted
# - Set admin user "sa" password (equivalent to root/admin user)
$ sudo /opt/mssql/bin/mssql-conf setup
Step 3: The service should now be up and running, so let's check it out:
$ systemctl status mssql-server.service
Step 4: Finally, use a Microsoft SQL Server compatible client or GUI to try to connect and do your stuff with your new database. I like DBeaver, so here is the install command in case you want to use it too:
# if you like to install using pacman:
sudo pacman -Syy dbeaver
# or, if you prefer to install using pamac:
sudo pamac install dbeaver
Step 5: If you decided to use DBeaver like me here is a small step by step guide to connect to your new DB as a bonus:
a. Database -> New Database Connection
b. Scroll down and look for the Microsoft SQL Server logo, click on it to select it and click Next.
c. Fill the connection info:
i. The hostname leave it as "localhost".
ii. Port should be 1433.
iii. Database/schema leave it as "master".
iv. Username should be "sa".
v. Fill the password you created on "Step 2" when setup your DB server.
d. Hit Finish
e. Now your server connection should show up in the left sidebar with the name "master".
f. Click on the arrow in the left of "master" and it will prompt you with a one time Download drivers window.
g. Hit Download/Next and it will download the drivers for you
h. Success! Now you can expand your db to navigate and do whatever you need to do.
You're welcome! :)
Hey, I have installed MSSQL. When I am trying to run the server with systemctl, it gives an error:
× mssql-server.service - Microsoft SQL Server Database Engine
Loaded: loaded (/usr/lib/systemd/system/mssql-server.service; enabled; preset: disabled
)
Active: failed (Result: exit-code) since Wed 2024-05-15 09:14:59 CEST; 3s ago
Duration: 2.793s
Docs: https://docs.microsoft.com/en-us/sql/linux
Process: 8606 ExecStart=/opt/mssql/bin/sqlservr (code=exited, status=18)
Main PID: 8606 (code=exited, status=18)
CPU: 3.775s
May 15 09:14:59 archlinux systemd[1]: mssql-server.service: Scheduled restart job, restart counter is at 3.
May 15 09:14:59 archlinux systemd[1]: mssql-server.service: Start request repeated too quickly.
May 15 09:14:59 archlinux systemd[1]: mssql-server.service: Failed with result 'exit-code'.
May 15 09:14:59 archlinux systemd[1]: Failed to start Microsoft SQL Server Database Engine.
May 15 09:14:59 archlinux systemd[1]: mssql-server.service: Consumed 3.775s CPU time, 664.6M memory peak, 0B memory swap peak.
I can't install mssql-server because libldap24 giving this error:
checking for compatible POSIX regex... no configure: error: broken POSIX regex! ==> ERROR: A failure occurred in build(). Aborting...
I tried to download and install libldap24 from aur first but its returning same error
mssql-server 16.0.4115.5-1 runs on linux kernel 6.8.1-arch1-1 big thanks !
Current link to download the rpm package https://pmc-geofence.trafficmanager.net/rhel/8/mssql-server-2022/Packages/m/mssql-server-16.0.4115.5-2.x86_64.rpm?geofence=true
Source seems to be down? For now I am using the actual link from packages.microsoft.com
Problem applies to kernel 6.7.0 , 6.7.1 and 6.7.2 (so far)
thanks @BenekDlugonogi for the info I will try a kernel downgrade
edit: Tried downgrade but after a few minutes got same error on 6.6.10.arch1-1
Pinned Comments
too commented on 2025-10-20 16:19 (UTC) (edited on 2025-10-20 16:20 (UTC) by too)
If the SQL Server does not start and the error is "Unable to set persistent hive root", create a root path for the SQLPAL registry hive:
doctorzeus commented on 2023-05-16 10:15 (UTC) (edited on 2023-06-17 03:56 (UTC) by doctorzeus)
This current package is MSSQLServer2022.
For anyone who needs to set the compatibility level of a db to migrate to an older version, see this article:
https://learn.microsoft.com/en-us/sql/t-sql/statements/alter-database-transact-sql-compatibility-level?view=sql-server-ver16
doctorzeus commented on 2023-02-22 22:23 (UTC) (edited on 2024-08-19 04:24 (UTC) by doctorzeus)
NOTES ON libldap 2.4:
Yes there is a newer version in the official repos but the binaries do not run without this version which is listed in the dependencies by Microsoft.
If you have a problem compiling libldapV2.4, go and ask on that package page, not here.
You can get libldap V2.4 here from this AUR package:
https://aur.archlinux.org/packages/libldap24