1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
PKGNAME=mssql-server
SUPPORTEDARCHES="x86_64"
DESCRIPTION="MS SQL Server 2019 from the official site"
DEBREPO="deb http://ftp.ru.debian.org/debian/ stretch main"
if [ "$1" = "--remove" ] ; then
epm remove $PKGNAME
echo
echo "Check data directory /var/opt/mssql if you need remove it too."
exit
fi
. $(dirname $0)/common.sh
serv mssql-server stop
dname="$(epm print info -s)"
dversion="$(epm print info -v)"
case "$(epm print info -d)" in
AstraLinux*)
# we have libc++1-9, but this package requires libc++1
epm ar $DEBREPO ; epm update
epm install libc++1
epm install https://packages.microsoft.com/ubuntu/20.04/mssql-server-2019/pool/main/m/mssql-server/mssql-server_1*_amd64.deb
epm rr $DEBREPO ; epm update
;;
ALTLinux)
epm install --repack https://packages.microsoft.com/rhel/8/mssql-server-2019/Packages/m/mssql-server-[0-9]*.x86_64.rpm || fatal
;;
Debian|Ubuntu)
epm install https://packages.microsoft.com/$dname/$dversion/mssql-server-2019/pool/main/m/mssql-server/mssql-server_1*_amd64.deb
;;
*)
fatal "$(epm print info -d) is not supported yet."
;;
esac
if [ -z "$auto" ] ; then
esu /opt/mssql/bin/mssql-conf setup accept-eula
serv mssql-server on
else
cat <<EOF
Run follow commands manually for complete the setup:
# /opt/mssql/bin/mssql-conf setup accept-eula
# serv mssql-server on
EOF
fi
cat <<EOF
Use follow command to check the connection to the MS SQL server:
$ /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -Q 'sp_databases'
EOF