Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Fix mssql package for Ubuntu 19.10
set -e -u
wget -qO- \
| sudo apt-key add -
echo 'deb [arch=amd64] xenial main' \
| sudo tee /etc/apt/sources.list.d/mssql-server.list
tmpd="$(mktemp -d -t mssql-linux.XXXXXXXXXXX)"
echo "Putting tmp files in ${tmpd}"
cd "${tmpd}"
apt download mssql-server
# Since we made a tmpdir, this should expand to only one file:
ar x mssql-server*.deb
gunzip control.tar.gz
tar -f control.tar './control' --extract -O \
| sed 's/libjemalloc1/libjemalloc2/g' > ./control
tar -f control.tar './control' --delete
tar -f control.tar './control' --update --owner=root --group=root
rm -f ./control
gzip control.tar
# Note: order of arguments matters here:
ar rcs mssql-server-fixed.deb debian-binary control.tar.gz data.tar.xz
sudo apt install -y libsss-nss-idmap0 libjemalloc2 libc++1
sudo apt-mark auto libsss-nss-idmap0 libjemalloc2 libc++1
sudo dpkg -i mssql-server-fixed.deb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment