I'm trying to update to node 7.x through the terminal on my raspberry pi and I keep encountering this error. The command I'm using is:sudo curl -sL https://deb.nodesource.com/setup_7.x | bash -Running this command as root doesn't work so I tried to see if apt-get was being used by any other processes. ps aux | grep aptpi        1295  0.0  0.1   4272  1848 pts/0    S+   06:24   0:00 grep --color=auto aptThis is all I get. Ultimately, (although it was initially advised not to do so), I tried removing the files and running the command again.sudo rm /var/lib/apt/lists/lock && sudo rm /var/lib/dpkg/lockNow neither one of these files no longer exists and I still receive the same error when trying to use curl. I also tried to kill that one process and I still get the error.
Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
debian;curl
The problem is that you sudo curl but not the bash call which call apt.just run it fully as root, for example :sudo sucurl -sL https://deb.nodesource.com/setup_7.x | bash -or you can do something likewget https://deb.nodesource.com/setup_7.xchmod +x setup_7.xsudo ./setup_7.x