0

trying to install nodejs on my unbuntu machine.

Followed these instructions where I first type:

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -

Then I type:

sudo apt-get install -y nodejs

and this is what I get:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libc-ares2 libnode72
Use 'sudo apt autoremove' to remove them.
The following packages will be upgraded:
  nodejs
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/25.4 MB of archives.
After this operation, 123 MB of additional disk space will be used.
(Reading database ... 191617 files and directories currently installed.)
Preparing to unpack .../nodejs_14.20.0-deb-1nodesource1_amd64.deb ...
Unpacking nodejs (14.20.0-deb-1nodesource1) over (12.22.9~dfsg-1ubuntu3) ...
dpkg: error processing archive /var/cache/apt/archives/nodejs_14.20.0-deb-1nodesource1_amd64.deb (--unpack):
 trying to overwrite '/usr/share/systemtap/tapset/node.stp', which is also in package libnode72:amd64 12.22.9~dfsg-1ubuntu3
Errors were encountered while processing:
 /var/cache/apt/archives/nodejs_14.20.0-deb-1nodesource1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Any idea how to fix this? thanks

karel
  • 110,292
  • 102
  • 269
  • 299
  • try `sudo apt autoremove` and then do your command again – Esther Jul 07 '22 at 18:53
  • 1
    Does this answer your question? [dpkg error: "trying to overwrite file, which is also in..."](https://askubuntu.com/questions/176121/dpkg-error-trying-to-overwrite-file-which-is-also-in) – karel Jul 08 '22 at 06:15
  • Hi thanks, I actually tried this and ran the command again...it gave another similar error. I have since abandoned the idea because I don't need to install the program that requires it. At the moment its unsolved, but not required. Thank again for your help. – Positron Jul 08 '22 at 14:00

0 Answers0