Sql-Server
Microsoft SQL Server 可以安裝在 Ubuntu 18.04 LTS 上嗎?
嘗試在 Ubuntu 18.04 上安裝 SQL Server,我得到了
# sudo apt-get install -y mssql-server Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: mssql-server : Depends: libcurl3 but it is not going to be installed Depends: openssl (<= 1.1.0) E: Unable to correct problems, you have held broken packages.
是否可以在 Ubuntu 18.04 上安裝 SQL Server 並且是否支持?
支持的
不,Microsoft 僅支持 16.04 LTS。兩年前的版本。
安裝
為了在 Ubuntu 上安裝新舊 SQL Server,我建議將其安裝為chroot。為此,首先安裝
debchroot
,然後使用該實用程序設置 chroot。sudo apt install debchroot sudo debootstrap --arch=amd64 xenial /opt/mschroot http://archive.ubuntu.com/ubuntu/
sudo mount --bind /proc /opt/mschroot/proc
現在跳進你的 chroot
sudo chroot /opt/mschroot
並著手配置它,
apt update ## Add the Universe Repository (needed https://dba.stackexchange.com/q/212868/2639) apt install wget software-properties-common apt-transport-https sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe" apt update ## Add Microsoft Repository wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list)" apt update ## Configuration complete begin install apt install -y mssql-server
然後配置它,(使用
2
開發人員選項)/opt/mssql/bin/mssql-conf setup
您必須選擇一個密碼,注意原因不明*密碼必須至少有 8 個字元長,並且包含以下四組中的三組字元:大寫字母、小寫字母、Base 10 數字和符號..*我建議大家使用
MICROSOFTsucksH4RD
, 因為它滿足。最後,不要忘記禁用間諜軟體。/opt/mssql/bin/mssql-conf set telemetry.customerfeedback false
我測試過的解決方案(在 Ask Ubuntu 上)有效,但有一個很大的缺點:
引用langioletto的回答:
Ubuntu 18.04 的明顯解決方案:
apt-get install -y libjemalloc1 libsss-nss-idmap0 libc++1 gawk curl curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - add-apt-repository "$(curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list)" add-apt-repository "$(curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list)" wget http://archive.ubuntu.com/ubuntu/pool/main/c/ca-certificates/ca-certificates_20160104ubuntu1_all.deb dpkg -i ca-certificates_20160104ubuntu1_all.deb wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/openssl_1.0.2g-1ubuntu4_amd64.deb dpkg -i openssl_1.0.2g-1ubuntu4_amd64.deb apt install -y libcurl3 apt-get update apt-get install -y mssql-server
缺點是如果這樣做
apt-get update
,mssql-server 將再次被刪除。即使您堅持在 v18.04 中執行,代理服務(作業)也會被禁用。因此,到目前為止,建議您在 ubuntu v16.04 上執行 SQL 2017。