Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:
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:
E: Sub-process /usr/bin/dpkg returned an error code (1)


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.

share|improve this question

marked as duplicate by BuZZ-dEE, Eliah Kagan, falconer, Radu Rădeanu, Braiam Jan 20 '14 at 17:37

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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

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

sudo dpkg -r nodejs
sudo apt-get install nodejs-legacy
share|improve this answer
I actually did this a couple of times trying to get it to work and this didn't work. But I found my solution in another post. – Tom Jan 20 '14 at 2:51
You says that you are trying to install nodejs-legacy and how did you remove a non installed package? – Avinash Raj Jan 20 '14 at 3:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.