Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dpkg: error processing archive ( On installing Nodejs)

This error occurred while installing nodejs https://i.sstatic.net/JMRiT.jpg

I am trying to install nodejs but facing this error while installing.

like image 645
Ankur Singh Avatar asked Mar 19 '26 00:03

Ankur Singh


1 Answers

I got the same error,

Preparing to unpack .../nodejs_18.15.0-deb-1nodesource1_amd64.deb ...
Unpacking nodejs (18.15.0-deb-1nodesource1) ...
dpkg: error processing archive /var/cache/apt/archives/nodejs_18.15.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_18.15.0-deb-1nodesource1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

but this is the exact error,

trying to overwrite '/usr/share/systemtap/tapset/node.stp', which is also in package libnode72:amd64 12.22.9~dfsg-1ubuntu3

In my case removed the libnode72 package by running the following command.

sudo apt remove libnode72

# If above does not work for you, run below commands

sudo dpkg --remove --force-remove-reinstreq libnode-dev
sudo dpkg --remove --force-remove-reinstreq libnode72:amd64

I think in your case you have to remove the libnode-dev package. Please try it by running the following command,

sudo apt remove libnode-dev

If this doesn't work for you or anyone, please add a comment.

like image 131
Kushan Gunasekera Avatar answered Mar 21 '26 14:03

Kushan Gunasekera