无法纠正问题,您持有破损的包裹

无法纠正问题,您持有破损的包裹

我在生产环境中有一台 Ubuntu 16.04 服务器,我想在上面安装nodenpm。因此我运行了这个:

sudo apt install nodejs nodejs-legacy npm

nodejs-旧版软件包仅用于为旧版 Node.js 代码提供符号链接,要求节点二进制文件为 /usr/bin/node(而不是 Debian 中提供的 /usr/bin/nodejs)。我发现我需要它才能在 Ubuntu 上制作nodenpm正常工作。

我已经在全新的 Ubuntu 16.04 服务器上运行过上述 apt install 命令多次,但在这个生产服务器上我出现了以下错误:

$ sudo apt install nodejs nodejs-legacy npm
[sudo] password for kramer65:
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:
 nodejs : Conflicts: nodejs-legacy
          Conflicts: npm
E: Unable to correct problems, you have held broken packages.

由于这在新的 Ubuntu 服务器上运行,所以我不知道为什么它在这个服务器上不起作用。

我检查了我的sources.list,但其中仅包含以下内容:

$ cat /etc/apt/sources.list
deb http://nl.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://nl.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb http://nl.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://nl.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://nl.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://nl.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu xenial-security main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted universe multiverse

有人知道我怎样才能找出这里出了什么问题吗?

相关内容