LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-20-2017, 05:39 AM   #1
Tim0th1
LQ Newbie
 
Registered: Oct 2017
Posts: 1

Rep: Reputation: Disabled
install node.js results in Sub-process /usr/bin/dpkg returned an error code (1)


hi, I'm trying to install node.js for the first time on ubuntu 16.04.3.

tim@tim-Inspiron-5767:~$ sudo apt-get install -y nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed
nodejs
0 to upgrade, 1 to newly install, 0 to remove and 5 not to upgrade.
17 not fully installed or removed.
Need to get 12.5 MB of archives.
After this operation, 57.6 MB of additional disk space will be used.
Get:1 https://deb.nodesource.com/node_8.x xenial/main amd64 nodejs amd64 8.7.0-1nodesource1 [12.5 MB]
Fetched 12.5 MB in 8s (1,461 kB/s)
(Reading database ... 220918 files and directories currently installed.)
Preparing to unpack .../nodejs_8.7.0-1nodesource1_amd64.deb ...
Unpacking nodejs (8.7.0-1nodesource1) ...
dpkg: error processing archive /var/cache/apt/archives/nodejs_8.7.0-1nodesource1_amd64.deb (--unpack):
unable to open '/usr/lib/node_modules/npm/node_modules/glob/sync.js.dpkg-new': Operation not permitted
Processing triggers for man-db (2.7.5-1) ...
Errors were encountered while processing:
/var/cache/apt/archives/nodejs_8.7.0-1nodesource1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)


There seem to be many posts online trying to fix this error code and for problems installing node.js.

I've tried a couple of hours worth of research solutions, including:
Code:
sudo apt-get update && sudo apt-get upgrade
Code:
sudo apt-get -f install
Code:
sudo dpkg --configure -a
Code:
sudo apt-get clean
I've also tried to install node.js via curl and from different repositories and tar.gz.

Code:
node -v
confirms that there is no version installed.
I've also tried to make sure:
Code:
apt-get remove --purge nodejs
I've rebooted and tried above all again.

Please can you explain what else I could try? thanks
 
Old 10-24-2017, 04:24 AM   #2
eklavya
Member
 
Registered: Mar 2013
Posts: 633

Rep: Reputation: 141Reputation: 141
Remove nodejs completely.
apt-get update
apt-get -f install

Make sure you do not get error, if yes solve it first.
Remove node modules completely using rm -r inside /usr/lib
Now try to install nodejs again.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
E: Sub-process /usr/bin/dpkg returned an error code (1) rayxoxo Linux - Newbie 2 05-25-2016 03:20 PM
Cannot install packages. E: Sub-process /usr/bin/dpkg returned an error code (1) tknpz Linux - Software 4 05-30-2013 08:48 PM
Sub-process /usr/bin/dpkg returned an error code (2) Don_Nadie Linux - Software 3 05-11-2013 10:17 PM
E:sub-process /usr/bin/dpkg returned an error code (2) elvisvite Linux - Software 0 12-11-2012 05:44 AM
E: Sub-process /usr/bin/dpkg returned an error code (1) Skullnick Linux - Software 2 01-30-2010 11:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration