sql-server - 在 linux 服务器 ubuntu 16.04 中安装 SQL Server 2019 时出错
问题描述
我尝试在我的 linux 服务器 ubuntu 16.04 LTS 中安装 SQL Server 2019。我只是按照 Microsoft Linux Sql Server Installation给出的步骤进行操作,但是当我尝试执行第二步时出现错误,即为 SQL Server 2019 注册 Microsoft SQL Server Ubuntu 存储库。我运行命令但出现了此错误:
错误一:
root@capt:/home/frenclub/Downloads# sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2019.list)"
收到错误
错误:“”无效
然后我将双引号更改为单引号,但仍然出现错误:
错误2:
root@capt:/home/frenclub/Downloads# sudo add-apt-repository '$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2019.list)'
收到错误
错误:'$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2019.list )' 无效
我已经尝试用谷歌搜索任何可能的解决方案,但我仍然找不到任何解决此问题的方法。谁能帮我解决这个问题?
解决方案
正如我的评论中提到的,我启动了一个运行 16.04 的容器并且无法复制它:
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:~#
但是,您可以尝试curl
手动使用和添加存储库的其他方法。
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
注意这些命令不要使用sudo
,因为我运行的是root
.
我可以确认在找到包之后运行sudo apt update
之后mssql-server
。
推荐阅读
- django - 单元测试 @verified_email_required 视图
- python - 创建函数以重命名熊猫数据框中的列
- javascript - 如何使用 vue 提交预填表单
- javascript - 删除reduce函数输出中的重复项
- java - 为什么“自定义 Enum 构造函数”会返回所有其他 Enum 类型的信息?
- reactjs - 2 使用反应路由器反应部署在同一域 nginx 问题上的项目
- c# - dateTime 以 UTC 存储在数据库中,但是当作为 C# 对象读取时,它会自动转换为本地时间,我只想要 UTC,如何?
- django - 如何在 Django 中从 POST 请求中提取数组
- r - dplyr case_when 具有动态案例数
- slack - Slack Dialog 外部数据源过滤