ubuntu - apt-get permission error on node.js setup -


i trying install node.js 7 on ubuntu. on running command

curl -sl https://deb.nodesource.com/setup_7.x | bash - 

or

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

i following error:

## installing nodesource node.js v7.x repo...   ## populating apt-get cache...  + apt-get update reading package lists... done w: chmod 0700 of directory /var/lib/apt/lists/partial failed - setupaptpartialdirectory (1: operation not permitted) e: not open lock file /var/lib/apt/lists/lock - open (13: permission denied) e: unable lock directory /var/lib/apt/lists/ w: problem unlinking file /var/cache/apt/pkgcache.bin - removecaches (13: permission denied) w: problem unlinking file /var/cache/apt/srcpkgcache.bin - removecaches (13: permission denied) error executing command, exiting 

i have run:

apt-get update 

this again results in error above, when run sudo apt-get update there no error again on running first 2 commands give error again.

i have tried autoremove purge , upgrade still problem persists. appreciate

by running

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

you running bash yourself, , curl root.and owner of bash process (you) didn't have rights write /var/lib/apt/lists/partial.
can try using :

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

you can check article more information.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -