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?

Braiam
  • 67,791
  • 32
  • 179
  • 269

4 Answers4

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)

Kaz Wolfe
  • 34,122
  • 21
  • 114
  • 172
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
Adithya Chakilam
  • 1,232
  • 1
  • 10
  • 13
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.

Dzero
  • 3,178
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.

guntbert
  • 13,134