简体   繁体   中英

Error during installing SQL Server 2019 in linux server ubuntu 16.04

I tried to install SQL Server 2019 in my linux server ubuntu 16.04 LTS. I just follow the step that given by Microsoft Linux Sql Server Installation But I got error when I try to do the second step which is Register the Microsoft SQL Server Ubuntu repository for SQL Server 2019. I run the command but this error appeared:

Error 1:

错误 1

root@capt:/home/frenclub/Downloads# sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2019.list)"

Receives the error

Error: '' invalid

Then I change the double quote to single quote but still I got error:

Error 2:

错误 2

root@capt:/home/frenclub/Downloads# sudo add-apt-repository '$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2019.list)'

Receives the error

Error: '$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2019.list )' invalid

I already try to google for any possible solution but I still cannot find any solution for this issue. Can anyone help me to solve this?

As mentioned in my comment, I spun up a Container Running 16.04 and couldn't replicate this:

thom@neith:~$ lxc launch ubuntu:16.04 u1604-mssql
Creating u1604-mssql
Starting u1604-mssql
thom@neith:~$ lxc exec u1604-mssql bash
root@u1604-mssql:~# wget -qO- https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
OK
root@u1604-mssql:~# add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2019.list)"
root@u1604-mssql:~#

You could, however, try to other method of using curl and adding the repository manually.

root@u1604-mssql:~# add-apt-repository -r "$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2019.list)" #You don't need this, but I am including a full script
root@u1604-mssql:~# #Add key if you haven't already
root@u1604-mssql:~# curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2019.list | tee /etc/apt/sources.list.d/mssql-prod.list
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   103  100   103    0     0    306      0 --:--:-- --:--:-- --:--:--   307
deb [arch=amd64,arm64,armhf] https://packages.microsoft.com/ubuntu/16.04/mssql-server-2019 xenial main

Note these commands do not use sudo , as I am running as root .

I can confirm that after running sudo apt update after both that the mssql-server package was found.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM