3

I'm trying to install git with

apt-get install git

it then says

E: Could not open lock fine /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

How do I get this?

0

4 Answers 4

11

Always do

sudo apt-get <command>

To drop into root,

sudo -i or sudo su (sudo -i is recommended and more proper, but it really doesn't matter)

4

to get into the you need to type the following command

$ sudo su

when prompted for password enter it.You can also use another command that is

$sudo -i
1
  • sudo su is completely unnecessary. Keep to sudo -i.
    – guntbert
    Nov 4, 2013 at 21:37
3

To execute any command as root just start with sudo then type the command
You will be asked for your password, the characters won't be shown, not even in dots, so just type the password and hit enter.

3

I think you should install git with root privilege. You can do it by typing sudo -i in terminal and then type password if it asks then you can run apt-get install git.

If root privilege is only the problem then this should work. Hope this works for you.

2
  • thank you it worked :D I didn't have to type the "sudo" part of the get-apt to get it to work. Nov 4, 2013 at 2:03
  • 1
    actually after being as a root user you don't have to type sudo Nov 4, 2013 at 5:58

Not the answer you're looking for? Browse other questions tagged .