# Updating node-red on RPi

**URL:** <https://discourse.nodered.org/t/updating-node-red-on-rpi/46504>\
**Category:** General\
**Created:** [31 May 2021 11:20 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504 "2021-05-31T11:20:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![lorccan](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@lorccan](https://discourse.nodered.org/u/lorccan)\
**Post date:** [31 May 2021 11:20 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504/1 "2021-05-31T11:20:13Z")

</div>

I am running node v14.17.0 and npm v7.15.0 on a Pi 4

I have an old install of node-red v 1.1.2 that I would like to upgrade, but I am hitting problems:

Using the official install script [https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered](https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) (which I understand is supposed also to update), I just saw node and node-red being removed and then it failed.

Next (after restoring my system from a backup taken just before running the script) I tried:

`apt-get install nodered`

but that got:

```auto
nodered : Depends: nodejs (>= 10) but it is not installable
           Depends: npm (>= 5.8) but it is not installable
E: Unable to correct problems, you have held broken packages.

```

I'm really stuck. Can anyone help please?

EDIT: I have checked for held packages with various tools, including `dpkg --get selections | grep hold` but nothing shows up.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [31 May 2021 11:47 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504/2 "2021-05-31T11:47:55Z")

</div>

> [@lorccan](#):
>
> I just saw node and node-red being removed and then it failed

What did it show. What was in the log.

> [@lorccan](#):
>
> apt-get install nodered

I'm pretty sure that tries to install a pretty old version of node-red.

Could you try the V2 (currently in development but so far it works well)...

> [@Help Wanted - testing updated install script](https://discourse.nodered.org/t/help-wanted-testing-updated-install-script/45685):
>
> Hi all, if anyone would like to help test the latest version of the Pi/Debian install script then I would be most grateful for some extra testing... Of course it should work fine... but the whole point is to find out where it doesn't - so make sure you don't do this on a critical system - and do have backups of your flows etc... The main changes (so far) are - if anything less than node12 installed - it will update to node14 (by default) - if 12 or above is installed default action is to leave…

---

<div class="post-metadata">

**Author:** ![lorccan](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@lorccan](https://discourse.nodered.org/u/lorccan)\
**Post date:** [31 May 2021 11:52 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504/3 "2021-05-31T11:52:00Z")

</div>

Thanks for replying. I don't have the logs from the first go, which is remiss of me, but I was keen to get back to the status quo ante so I restored enthusiastically!

I'm just going to backup my test platform again and then I'll try with the V2 script and report back.

---

<div class="post-metadata">

**Author:** ![lorccan](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@lorccan](https://discourse.nodered.org/u/lorccan)\
**Post date:** [31 May 2021 12:05 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504/4 "2021-05-31T12:05:43Z")

</div>

Don't know what's happening here. It "helpfully" blew away node and npm and then seems to complain that it can't find them. (This, however, is log from a second run. I am going to go through the restore and run again, to see exactly what's happening when a valid node and npm install actually exists.)

```auto
Running Node-RED update for user pi at /home/pi on raspbian

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 ✔   
  Install Node.js 14 LTS ✘ Bad install: Node.js missing Npm missing - Exit
  Clean npm cache                     
  Install Node-RED core               
  Move global nodes to local          
  Npm rebuild existing nodes          
  Install extra Pi nodes              
  Add shortcut commands               
  Update systemd script               
                                      

Any errors will be logged to /var/log/nodered-install.log

pi@homebridge:~ $ cat /var/log/nodered-install.log
OLD nodejs 0 :
NEW nodejs 14 :

***************************************

Started : Mon 31 May 13:02:21 BST 2021
Running for user pi at /home/pi
Found global nodes: :

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodered' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Installing nodejs 14

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package 'npm' is not installed, so not removed
Package 'nodejs' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
dpkg: warning: ignoring request to remove nodejs which isn't installed
dpkg: warning: ignoring request to remove node which isn't installed

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Grab the LTS bundle

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
curl is already the newest version (7.64.0-4+deb10u2).
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

## Installing the NodeSource Node.js 14.x repo...

## Populating apt-get cache...

+ apt-get update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://phoscon.de/apt/deconz buster InRelease
Hit:3 http://archive.raspberrypi.org/debian buster InRelease
Hit:4 https://deb.nodesource.com/node_14.x buster InRelease
Hit:5 https://repo.mosquitto.org/debian buster InRelease
Reading package lists...

## Confirming "buster" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_14.x/dists/buster/Release'

## Adding the NodeSource signing key to your keyring...

+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodesource.gpg >/dev/null
gpg: WARNING: unsafe ownership on homedir '/home/pi/.gnupg'

## Creating apt sources list file for the NodeSource Node.js 14.x repo...

+ echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x buster main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x buster main' >> /etc/apt/sources.list.d/nodesource.list

## Running `apt-get update` for you...

+ apt-get update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Hit:3 http://phoscon.de/apt/deconz buster InRelease
Hit:4 https://deb.nodesource.com/node_14.x buster InRelease
Hit:5 https://repo.mosquitto.org/debian buster InRelease
Reading package lists...

## Run `sudo apt-get install -y nodejs` to install Node.js 14.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 | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
     echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] 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

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package nodejs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  nodejs-doc

E: Package 'nodejs' has no installation candidate
\nVersions: node:missing npm:missing\n

```

---

<div class="post-metadata">

**Author:** ![lorccan](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@lorccan](https://discourse.nodered.org/u/lorccan)\
**Post date:** [31 May 2021 12:22 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504/5 "2021-05-31T12:22:03Z")

</div>

OK, I have restored and run again from scratch with no flags.

First of all, a check `node -v` returns `v14.17.0` and `npm -v` returns `v7.15.0`

Here's the output:

```auto
Running Node-RED update for user pi at /home/pi on raspbian

This can take 20-30 minutes on the slower Pi versions - please wait.

  Stop Node-RED ✔
  Remove old version of Node-RED ✔
  Node option not specified : --node12 or --node14
  Leave existing Node.js ✘ Bad install: Node.js missing Npm missing - Exit
  Clean npm cache                     
  Install Node-RED core               
  Move global nodes to local          
  Npm rebuild existing nodes          
  Install extra Pi nodes              
  Add shortcut commands               
  Update systemd script               
                                      

Any errors will be logged to /var/log/nodered-install.log

```

and the log:

```auto
Already have nodejs v14.17.0
OLD nodejs 14 :
NEW nodejs :

***************************************

Started : Mon 31 May 13:17:33 BST 2021
Running for user pi at /home/pi
Found global nodes: node-red-contrib-homebridge-automation
node-red-contrib-play-audio
node-red-node-pi-gpio
node-red-node-ping
node-red-node-random
node-red-node-serialport
node-red-node-smooth :

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodered' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
\nVersions: node:missing npm:missing\n

```

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [31 May 2021 12:31 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504/6 "2021-05-31T12:31:31Z")

</div>

Just checking, what sort of pi are you using and what OS are you using on it?

---

<div class="post-metadata">

**Author:** ![lorccan](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@lorccan](https://discourse.nodered.org/u/lorccan)\
**Post date:** [31 May 2021 12:37 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504/7 "2021-05-31T12:37:35Z")

</div>

Its a Pi 4 with 8GB RAM running Raspbian GNU/Linux Version 10 'buster'

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [31 May 2021 13:06 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504/8 "2021-05-31T13:06:43Z")

</div>

How did you install nodejs in the first place ? Is it using n or nvm ?

---

<div class="post-metadata">

**Author:** ![lorccan](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@lorccan](https://discourse.nodered.org/u/lorccan)\
**Post date:** [31 May 2021 14:25 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504/9 "2021-05-31T14:25:04Z")

</div>

I don't remember, sorry. However, I don't use nvm so I know it would not have been using that. There's never any problem in updating node when I need to.

I don't know whether this might help, but both node and npm are installed in `/usr/local/bin/`

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [31 May 2021 17:12 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504/10 "2021-05-31T17:12:13Z")

</div>

And did you try the new installer ?

---

<div class="post-metadata">

**Author:** ![lorccan](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@lorccan](https://discourse.nodered.org/u/lorccan)\
**Post date:** [31 May 2021 17:36 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504/11 "2021-05-31T17:36:15Z")

</div>

Do you mean did I try the V2 install script as recommended by @Steve-Mcl?

If so, my responses since then have been in relation to that script.

If there's another one, please point me at it.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [31 May 2021 17:45 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504/12 "2021-05-31T17:45:08Z")

</div>

hmm - yes that one.. can you try with the --node14 flag to force it to reload nodejs.  
(usually it is installed into /usr/bin)

---

<div class="post-metadata">

**Author:** ![lorccan](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@lorccan](https://discourse.nodered.org/u/lorccan)\
**Post date:** [31 May 2021 17:52 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504/13 "2021-05-31T17:52:01Z")

</div>

I tried it with no flags and with that flag and I've shown the results. Perhaps the install location is the issue?

I don't understand how the script reports that it removes the old version of node [which it has - so presumably it should know where it removed it from] but then complains "Bad install: Node.js missing Npm missing - Exit" when it's trying to install Node.js 14 LTS.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [31 May 2021 19:26 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504/14 "2021-05-31T19:26:38Z")

</div>

Is most odd -  
it reports

```auto
Hit:4 https://deb.nodesource.com/node_14.x buster InRelease

```

but then says

```auto
Package nodejs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  nodejs-doc

E: Package 'nodejs' has no installation candidate
\nVersions: node:missing npm:missing\n

```

Which makes no sense...

What happens if you run `sudo apt update` now - it should again find the nodesource files... and then manually `sudo apt install nodejs`  
What does that report ?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [31 May 2021 20:22 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504/15 "2021-05-31T20:22:39Z")

</div>

> [@dceejay](#):
>
> sudo apt get update

A typo there I think. It should be `sudo apt update` (or the old format `sudo apt-get update`).

---

<div class="post-metadata">

**Author:** ![lorccan](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@lorccan](https://discourse.nodered.org/u/lorccan)\
**Post date:** [1 June 2021 09:04 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504/16 "2021-06-01T09:04:48Z")

</div>

Just had a chance to try this now. Using restored system (so the same starting point as all the other attempts):

`node -v` returns `v14.17.0` and `npm -v` returns `v7.15.0`

`bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/v2/deb/update-nodejs-and-nodered) --node14`

This is the output, followed by the log:

```auto
Running Node-RED update for user pi at /home/pi on raspbian

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 ✔ v14.17.0
  Install Node.js 14 LTS ✘ Bad install: Node.js missing Npm missing - Exit
  Clean npm cache                     
  Install Node-RED core               
  Move global nodes to local          
  Npm rebuild existing nodes          
  Install extra Pi nodes              
  Add shortcut commands               
  Update systemd script               
                                      

Any errors will be logged to /var/log/nodered-install.log

pi@homebridge:~ $ cat /var/log/nodered-install.log 
Already have nodejs v14.17.0
OLD nodejs 14 :
NEW nodejs 14 :

***************************************

Started : Tue 1 Jun 09:55:24 BST 2021
Running for user pi at /home/pi
Found global nodes: node-red-contrib-homebridge-automation
node-red-contrib-play-audio
node-red-node-pi-gpio
node-red-node-ping
node-red-node-random
node-red-node-serialport
node-red-node-smooth :

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodered' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Installing nodejs 14

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodejs-legacy' is not installed, so not removed
Package 'nodejs' is not installed, so not removed
Package 'npm' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
dpkg: warning: ignoring request to remove nodejs which isn't installed
dpkg: warning: ignoring request to remove node which isn't installed

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Grab the LTS bundle

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
curl is already the newest version (7.64.0-4+deb10u2).
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

## Installing the NodeSource Node.js 14.x repo...

## Populating apt-get cache...

+ apt-get update
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:3 http://phoscon.de/apt/deconz buster InRelease
Hit:4 https://repo.mosquitto.org/debian buster InRelease
Reading package lists...

## Confirming "buster" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_14.x/dists/buster/Release'

## Adding the NodeSource signing key to your keyring...

+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodesource.gpg >/dev/null
gpg: WARNING: unsafe ownership on homedir '/home/pi/.gnupg'

## Creating apt sources list file for the NodeSource Node.js 14.x repo...

+ echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x buster main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x buster main' >> /etc/apt/sources.list.d/nodesource.list

## Running `apt-get update` for you...

+ apt-get update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://phoscon.de/apt/deconz buster InRelease
Hit:3 http://archive.raspberrypi.org/debian buster InRelease
Hit:4 https://repo.mosquitto.org/debian buster InRelease
Get:5 https://deb.nodesource.com/node_14.x buster InRelease [4,584 B]
Get:6 https://deb.nodesource.com/node_14.x buster/main armhf Packages [774 B]
Fetched 5,358 B in 3s (2,112 B/s)
Reading package lists...

## Run `sudo apt-get install -y nodejs` to install Node.js 14.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 | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
     echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] 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

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package nodejs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  nodejs-doc

E: Package 'nodejs' has no installation candidate
\nVersions: node:missing npm:missing\n

```

Then I did: `sudo apt update`, which returned:

```auto
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease                                                                       
Hit:3 http://phoscon.de/apt/deconz buster InRelease                                                                                
Hit:4 https://repo.mosquitto.org/debian buster InRelease                                                                    
Hit:5 https://deb.nodesource.com/node_14.x buster InRelease                                           
Reading package lists... Done                      
Building dependency tree       
Reading state information... Done
4 packages can be upgraded. Run 'apt list --upgradable' to see them.

```

Then: `sudo apt install nodejs`, which got:

```auto
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package nodejs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  nodejs-doc

E: Package 'nodejs' has no installation candidate

```

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [1 June 2021 09:21 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504/17 "2021-06-01T09:21:03Z")

</div>

What do you have inside `/etc/apt/sources.list`?

For reference, I have

```auto
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi

```

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [1 June 2021 09:25 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504/18 "2021-06-01T09:25:44Z")

</div>

> [@lorccan](#):
>
> `gpg: WARNING: unsafe ownership on homedir '/home/pi/.gnupg'`

Also, cant help but feel you have other issues for example ↑ this.

Searching the net there are a few comments, one in particular...

> You probably migrated your `.gnupg` folder from another machine, or tampered another way with the file permissions.
> 
> GnuPG enforces private ownership of the folder and some files for security reasons.
> 
> These two lines fix the permissions. The first one ensures that the `~/.gnupg` folder (and everything in it) is actually yours. To possibly overtake ownership, it requires root privileges, thus the `sudo` . The second line makes sure nobody but you can read its contents (remove read, write and execute permissions for group and other users). Your username gets inserted automatically, so you can copy-past the lines directly to your terminal:
> 
> ```auto
> sudo chown -R ${USER}:${USER} ~/.gnupg
> chmod -R go-rwx ~/.gnupg
> 
> ```

REF: ["Unsafe permissions on configuration file `/home/david/.gnupg/gpg.conf" What does it mean and how to fix? - Ask Ubuntu](https://askubuntu.com/questions/330755/unsafe-permissions-on-configuration-file-home-david-gnupg-gpg-conf-what-doe)

and ...

> This is the result of running `gpg` with `sudo` : `gpg` then runs as root, but its home directory is still the user’s. This explains both the warning ( `gpg` is running as root but another user owns the configuration directory) and `dirmngr` ’s socket’s ownership.
> 
> To fix this up, you should stop `dirmngr` :
> 
> ```auto
> sudo gpgconf --kill dirmngr
> 
> ```
> 
> ( `sudo` just this once because `dirmngr` is running as root, as evidenced by its socket), then restore your ownership:
> 
> ```auto
> sudo chown -R $USER ~/.gnupg
> 
> ```

REF: [permissions - gpg: WARNING: unsafe ownership on homedir '/home/user/.gnupg' - Unix & Linux Stack Exchange](https://unix.stackexchange.com/questions/452020/gpg-warning-unsafe-ownership-on-homedir-home-user-gnupg)

---

<div class="post-metadata">

**Author:** ![lorccan](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@lorccan](https://discourse.nodered.org/u/lorccan)\
**Post date:** [1 June 2021 09:27 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504/19 "2021-06-01T09:27:00Z")

</div>

```auto
$ cat sources.list
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi

```

---

<div class="post-metadata">

**Author:** ![lorccan](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@lorccan](https://discourse.nodered.org/u/lorccan)\
**Post date:** [1 June 2021 09:30 UTC](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504/20 "2021-06-01T09:30:02Z")

</div>

Thanks. I think at this stage that I am going to blow away the problematic system and start with a new one. I just tested the script on another pi and it worked with no issues reported.

I don't want to drag the work off course with a rogue, so thanks to all who responded.

[Next page](https://discourse.nodered.org/t/updating-node-red-on-rpi/46504.md?page=2)
