• Uncategorized

About linux : When-running-command-curl–fsSL-httpsdebnodesourcecomsetup16x-bash—I-get-errors-about-permission-being-denied

Question Detail

I’m trying to host a discord bot on my linux VM and part of the process is to run curl -fsSL https://deb.nodesource.com/setup_16.x | bash - after which i install NodeJS. However, when i run curl -fsSL https://deb.nodesource.com/setup_16.x | bash - I get this back

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


## Populating apt-get cache...

+ apt-get update
Reading package lists... Done
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
Error executing command, exiting

I have tried running it like sudo curl -fsSL https://deb.nodesource.com/setup_16.x | bash - but that doesn’t help.

Any help is appreciated, thanks.

Question Answer

I guess you need to put the sudo in front of the bash command; try

curl -fsSL https://deb.nodesource.com/setup_16.x | sudo bash

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.