我尝试通过执行以下命令为php安装mssql-tool包:
sudo su
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-tools.list
exit
sudo ACCEPT_EULA=Y apt-get install mssql-tools
我收到错误类型:
我现在想知道,如果第二个错误是由第一个错误引起的,以及如何修复第一个错误?
服务器规范:Ubuntu 16.04.2 LTS(GNU / Linux 4.4.0-042stab120.20 x86_64)。
root:~# sudo su
root:~# curl https://packages.microsoft.com/config/ubuntu/16.04/prod.li st > /etc/apt/sources.list.d/mssql-tools.list
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 79 100 79 0 0 483 0 --:--:-- --:--:-- --:--:-- 481
root:~# exit
exit
root:~# sudo ACCEPT_EULA=Y apt-get install mssql-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/msprod.list:1 and /etc/apt/sources.list.d/mssql-release. list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /e tc/apt/sources.list.d/msprod.list:1 and /etc/apt/sources.list.d/mssql-release.li st:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times i n /etc/apt/sources.list.d/msprod.list:1 and /etc/apt/sources.list.d/mssql-releas e.list:1
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/msprod.list:1 and /etc/apt/sources.list.d/mssql-tools.li st:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /e tc/apt/sources.list.d/msprod.list:1 and /etc/apt/sources.list.d/mssql-tools.list :1
W: Target Translations (main/i18n/Translation-en) is configured multiple times i n /etc/apt/sources.list.d/msprod.list:1 and /etc/apt/sources.list.d/mssql-tools. list:1
E: Unable to locate package mssql-tools
如果我在命令中包含apt-get update,系统会被0%工作:
卡住root:~# sudo su
root:~# curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-tools.list
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 79 100 79 0 0 502 0 --:--:-- --:--:-- --:--:-- 506
root:~# exit
exit
root:~# sudo apt-get update
Hit:1 http://autoinstall.plesk.com/ubuntu/PSA_17.5.3 xenial InRelease
Hit:2 http://autoinstall.plesk.com/ubuntu/PHP56_17 xenial InRelease
Hit:3 http://autoinstall.plesk.com/ubuntu/PHP70_17 xenial InRelease
Hit:4 http://autoinstall.plesk.com/ubuntu/PHP71_17 xenial InRelease
Hit:5 http://autoinstall.plesk.com/ubuntu/NGINX17 xenial InRelease
0% [Working]
答案 0 :(得分:0)
你可以解决这个问题' W:Target Packages'问题,试试这个commants,
1) sudo apt install python3-apt
2) sudo wget https://raw.githubusercontent.com/davidfoerster/apt-remove-duplicate-source-entries/master/apt-remove-duplicate-source-entries.py
3) sudo chmod +x apt-remove-duplicate-source-entries.py
4) sudo ./apt-remove-duplicate-source-entries.py