0

I have no idea what the problem is, but I keep trying to install nodejs-legacy by running sudo apt-get install, but it keeps failing. Here's all of the output when I try to do the command.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  ax25-node libax25 libc-ares2 libv8-3.14.5 openbsd-inetd
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  nodejs-legacy
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
Need to get 0 B/15.4 kB of archives.
After this operation, 119 kB of additional disk space will be used.
(Reading database ... 198807 files and directories currently installed.)
Unpacking nodejs-legacy (from .../nodejs-legacy_0.10.15~dfsg1-4_all.deb) ...
dpkg: error processing /var/cache/apt/archives/nodejs-legacy_0.10.15~dfsg1-4_all.deb (--unpack):
 trying to overwrite '/usr/share/man/man1/node.1.gz', which is also in package nodejs 0.10.24-1chl1~saucy1
Processing triggers for man-db ...
Errors were encountered while processing:
 /var/cache/apt/archives/nodejs-legacy_0.10.15~dfsg1-4_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Solution:

So I found the answer to my question in another thread. I had to use sudo dpkg -r nodejs-legacy and sudo apt-get -f install.

So, credit for where credit is due, here is the link the answer that explained to me what I had to do.

https://askubuntu.com/a/185123/237774

Tom
  • 11
  • 1
  • 1
  • 4
  • Is there any way I can actually mark it as duplicate, rather than just possible duplicate? @souravc – Tom Jan 20 '14 at 03:16

1 Answers1

3

Try to remove previously installed nodejs package and then install nodejs-legacy package.

sudo dpkg -r nodejs
sudo apt-get install nodejs-legacy
Avinash Raj
  • 78,556