tango4567 / solutions

Here I am adding lots of different stuff. This is the collection of problems with their solutions. Most important please share good vibes and correct me if you found anything wrong here. Thanks in advance.
Apache License 2.0
5 stars 0 forks source link

Upgrading nodejs on Ubuntu: How to fix broken pipe error? #62

Closed tango4567 closed 1 year ago

tango4567 commented 1 year ago
The following packages will be upgraded:
  nodejs
1 upgraded, 0 newly installed, 0 to remove and 17 not upgraded.
Need to get 0 B/30.3 MB of archives.
After this operation, 193 MB of additional disk space will be used.
(Reading database ... 249732 files and directories currently installed.)
Preparing to unpack .../nodejs_20.5.1-deb-1nodesource1_amd64.deb ...
Unpacking nodejs (20.5.1-deb-1nodesource1) over (12.22.9~dfsg-1ubuntu3) ...
dpkg: error processing archive /var/cache/apt/archives/nodejs_20.5.1-deb-1nodesource1_amd64.deb (--unpack):
 trying to overwrite '/usr/include/node/common.gypi', which is also in package libnode-dev 12.22.9~dfsg-1ubuntu3
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/nodejs_20.5.1-deb-1nodesource1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
tango4567 commented 1 year ago

Source for Solution:

  1. Installation instruction node
  2. Got error while installing nodejs
  3. Stackexchange

Node.js v20.x: Using Ubuntu

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - &&\
sudo apt-get install -y nodejs

After getting pipe error please follow below instructions Update apt, fix the install, remove nodejs and the nodejs-doc packages

sudo apt --fix-broken install
sudo apt update
sudo apt-get install -y nodejs