Posts: 4
Joined: Sat Mar 23, 2013 9:19 pm

permission denied

Sat Mar 23, 2013 9:26 pm

i have a problem nearly everything i try to du with my raspberry pi it always says:
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

or nearly this.

any help? im seriously gonna getting pissed of because now i had my raspberry pi in a week and it always says that

please help

User avatar
Posts: 14748
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: permission denied

Sat Mar 23, 2013 9:52 pm

You need to elevate your privileges. Precede the command with sudo.

Posts: 40
Joined: Mon Mar 11, 2013 6:27 pm

Re: permission denied

Sun Mar 24, 2013 11:43 pm

once you are at a command prompt, just type in this:

sudo bash and press enter. it will allow you to run commands without having to type sudo before it each time

example: before you would have to type
sudo apt-get upgrade
to upgrade your packages

now all you have to type is
apt-get upgrade

saves you a little bit of time

User avatar
Posts: 951
Joined: Wed Dec 26, 2012 3:46 am

Re: permission denied

Mon Mar 25, 2013 12:18 am

Commands requiring 'root' access (root is the user account that is allowed to do anything, kind of like Administrator accounts in Windows), need the command 'sudo' placed before your command.

E.g. if you log in as 'pi' (a normal, unprivileged account), and want to run:

apt-get update
apt-get upgrade
apt-get install htop

You actually need to type:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install htop

to perform these actions. You will be asked for your password to proceed.

This is a normal and everyday way for Linux systems to help prevent users from accidentally running commands that really need the concious approval of the system administrator.

i.e. it is designed to save your bacon.
Posts: 1
Joined: Mon Jan 21, 2019 7:33 am

Re: permission denied

Mon Jan 21, 2019 7:54 am

I used this command "/etc/modprobe.d/ipv6.conf" to enable the ipv6 .
but when i entered this command it throws me a error : bash: /etc/modprobe.d/ipv6.conf: permission denied .
can anyone help me out this problem...

Return to “Beginners”