Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)

The problem is that you sudo curl but not the bash call which call apt. just run it fully as root, for example :

sudo su
curl -sL https://deb.nodesource.com/setup_7.x | bash -

or you can do something like

wget https://deb.nodesource.com/setup_7.x
chmod +x setup_7.x
sudo ./setup_7.x

Remove the lock file

sudo rm /var/lib/apt/lists/lock

Then run the command as root or add sudo -E as follows :

curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -

Tags:

Curl

Debian