【发布时间】:2014-08-02 11:52:33
【问题描述】:
所以我在进行 apt-get upgrade 时收到此错误
Setting up nodejs (0.10.30-1chl1~trusty1) ...
update-alternatives: error: alternative link /usr/bin/node is already managed by nodejs
dpkg: error processing package nodejs (--configure): subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing: nodejs
E: Sub-process /usr/bin/dpkg returned an error code (1)
注意:“nodejs --version”有效,我得到一个干净的“v0.10.30”,但“node --version”没有,因为没有链接。
到目前为止,我已经尝试过:
- 完全删除 nodejs 并重新安装
- 我在删除 nodejs 后手动删除了指向 nodejs 的链接 /usr/bin/node,因为它仍然存在并且问题与 update-alternatives 相关
- 使用“update-alternatives --config nodesjs”(我第一次使用时,有些东西坏了并修复了,但并没有解决问题。此后该错误不再出现)。
【问题讨论】:
-
apt-cache policy nodejs的输出是什么? -
你是用this PPA安装node还是?
-
@mscdex:是的,我正在使用 Chris Lea 的 PPA。
-
@Salem: "apt-cache policy nodejs" 给出了这个 nodejs: 已安装: (none) 候选: 0.10.30-1chl1~trusty1 版本表: 0.10.30-1chl1~trusty1 0 500 @987654322 @ amd64 包 0.10.25~dfsg2-2ubuntu1 0 500 ubuntu.securedservers.com trusty/universe amd64 包
标签: node.js installation upgrade ubuntu-14.04