E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. pi@emonpi:/var/log $ ^C pi@emonpi:/var/log $ sudo dpkg --configure -a pi@emonpi:/var/log $ ^C pi@emonpi:/var/log $ bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered) This script will remove versions of Node.js prior to version 7.x, and Node-RED and if necessary replace them with Node.js 10.x LTS (dubnium) and the latest Node-RED from Npm. It also moves any Node-RED nodes that are globally installed into your user ~/.node-red/node_modules directory, and adds them to your package.json, so that you can manage them with the palette manager. It also tries to run 'npm rebuild' to refresh any extra nodes you have installed that may have a native binary component. While this normally works ok, you need to check that it succeeds for your combination of installed nodes. To do all this it runs commands as root - please satisfy yourself that this will not damage your Pi, or otherwise compromise your configuration. If in doubt please backup your SD card first. Are you really sure you want to do this ? [y/N] ? y Would you like to install the Pi-specific nodes ? [y/N] ? y Running Node-RED install for user pi at /home/pi This can take 20-30 minutes on the slower Pi versions - please wait. Stop Node-RED ✔ Remove old version of Node-RED ✔ Remove old version of Node.js ✔ Update Node.js LTS ✘ Failed to install Node.js - Exit Clean npm cache Install Node-RED core Move global nodes to local Install extra Pi nodes Npm rebuild existing nodes Add shortcut commands Update systemd script Any errors will be logged to /var/log/nodered-install.log pi@emonpi:/var/log $ ls -all total 196 drwxr-xr-x 11 root root 560 Nov 29 16:02 . drwxr-xr-x 12 root root 4096 Aug 2 10:53 .. drwxr-xr-x 2 root adm 100 Nov 29 15:17 apache2 -rw-r----- 1 root adm 17340 Nov 29 16:05 auth.log -rw-r--r-- 1 root root 6252 Nov 29 15:17 boot.log -rw------- 1 root utmp 0 Nov 29 15:17 btmp -rw-r----- 1 root adm 26003 Nov 29 15:53 daemon.log -rw-r----- 1 root adm 1177 Nov 29 15:17 debug -rw-r--r-- 1 root root 47 Nov 29 16:02 dpkg.log -rw-rw-rw- 1 root root 186 Nov 29 15:17 emoncms.log drwxr-xr-x 2 emonhub root 60 Nov 29 15:17 emonhub drwxr-xr-x 2 pi root 60 Nov 29 15:17 emonpilcd -rw-r----- 1 root adm 25784 Nov 29 15:17 kern.log drwxr-xr-x 2 pi pi 40 Nov 29 15:17 logrotate -rw-r----- 1 root adm 24110 Nov 29 15:17 messages drwxr-xr-x 2 mosquitto mosquitto 60 Nov 29 15:17 mosquitto -rw-rw-rw- 1 root root 0 Nov 29 15:17 mqtt_input.log drwxr-xr-x 2 mysql adm 60 Nov 29 15:17 mysql -rw-rw-rw- 1 root root 0 Nov 29 15:17 mysql.log -rw-r--r-- 1 root root 4542 Nov 29 16:04 nodered-install.log -rw-rw-rw- 1 root root 0 Nov 29 15:17 ntp_update.log drwxr-xr-x 2 root root 40 Nov 29 15:17 openhab drwxr-xr-x 2 redis redis 60 Nov 29 15:17 redis -rw-rw-rw- 1 root root 0 Nov 29 15:17 service-runner.log drwxr-xr-x 2 root root 60 Nov 29 15:17 supervisor -rw-r----- 1 root adm 53427 Nov 29 16:05 syslog -rw-r----- 1 root adm 190 Nov 29 15:17 user.log -rw-rw-r-- 1 root utmp 1920 Nov 29 15:46 wtmp pi@emonpi:/var/log $ cat nodered-install.log *************************************** Started : Thu 29 Nov 15:55:21 UTC 2018 Running for user pi at /home/pi Failed to stop nodered.service: Unit nodered.service not loaded. Found global nodes: : E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. ## Installing the NodeSource Node.js 10.x repo... ## Populating apt-get cache... + apt-get update Hit:1 http://archive.raspberrypi.org/debian stretch InRelease Hit:2 http://raspbian.raspberrypi.org/raspbian stretch InRelease Hit:3 https://deb.nodesource.com/node_10.x stretch InRelease Reading package lists... ## Confirming "stretch" is supported... + curl -sLf -o /dev/null 'https://deb.nodesource.com/node_10.x/dists/stretch/Release' ## Adding the NodeSource signing key to your keyring... + curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - Warning: apt-key output should not be parsed (stdout is not a terminal) OK ## Creating apt sources list file for the NodeSource Node.js 10.x repo... + echo 'deb https://deb.nodesource.com/node_10.x stretch main' > /etc/apt/sources.list.d/nodesource.list + echo 'deb-src https://deb.nodesource.com/node_10.x stretch main' >> /etc/apt/sources.list.d/nodesource.list ## Running `apt-get update` for you... + apt-get update Hit:1 http://archive.raspberrypi.org/debian stretch InRelease Hit:2 http://raspbian.raspberrypi.org/raspbian stretch InRelease Hit:3 https://deb.nodesource.com/node_10.x stretch InRelease Reading package lists... ## Run `sudo apt-get install -y nodejs` to install Node.js 10.x and npm ## You may also need development tools to build native addons: sudo apt-get install gcc g++ make ## To install the Yarn package manager, run: curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt-get update && sudo apt-get install yarn E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. *************************************** Started : Thu 29 Nov 16:03:36 UTC 2018 Running for user pi at /home/pi Failed to stop nodered.service: Unit nodered.service not loaded. Found global nodes: : Reading package lists... Building dependency tree... Reading state information... E: The package nodejs needs to be reinstalled, but I can't find an archive for it. Reading package lists... Building dependency tree... Reading state information... E: The package nodejs needs to be reinstalled, but I can't find an archive for it. ## Installing the NodeSource Node.js 10.x repo... ## Populating apt-get cache... + apt-get update Hit:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease Hit:2 http://archive.raspberrypi.org/debian stretch InRelease Hit:3 https://deb.nodesource.com/node_10.x stretch InRelease Reading package lists... ## Confirming "stretch" is supported... + curl -sLf -o /dev/null 'https://deb.nodesource.com/node_10.x/dists/stretch/Release' ## Adding the NodeSource signing key to your keyring... + curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - Warning: apt-key output should not be parsed (stdout is not a terminal) OK ## Creating apt sources list file for the NodeSource Node.js 10.x repo... + echo 'deb https://deb.nodesource.com/node_10.x stretch main' > /etc/apt/sources.list.d/nodesource.list + echo 'deb-src https://deb.nodesource.com/node_10.x stretch main' >> /etc/apt/sources.list.d/nodesource.list ## Running `apt-get update` for you... + apt-get update Hit:1 http://archive.raspberrypi.org/debian stretch InRelease Hit:2 http://raspbian.raspberrypi.org/raspbian stretch InRelease Hit:3 https://deb.nodesource.com/node_10.x stretch InRelease Reading package lists... ## Run `sudo apt-get install -y nodejs` to install Node.js 10.x and npm ## You may also need development tools to build native addons: sudo apt-get install gcc g++ make ## To install the Yarn package manager, run: curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt-get update && sudo apt-get install yarn Reading package lists... Building dependency tree... Reading state information... E: The package nodejs needs to be reinstalled, but I can't find an archive for it. pi@emonpi:/var/log $