2

I tried to install Git using this command apt-get install git, but getting this:

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?

What's problem?

I tried these :

sudo apt-get update
sudo apt-get upgrade
sudo apt-get -f install
,

but it doesn't work.

  • 1
    sudo apt-get install git ? – Djax Nov 4 '15 at 14:26
4

The main key word/phrase to find solution is are you root ?

That means the command needs root privileges to run.

From man page of sudo

sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy.

Use sudo to run a command with root privileges.

So run sudo apt-get install git

2
sudo apt-get install git

then just type your password (invisible). I also installed git with elementary, the same as Ubuntu and works.

Also, you can use the root command su (not recomended) instead of sudo but you need to create a password for use su with sudo passwd root

1

For apt-get install git you can get this result, but for other commands it cannot be. you need to use sudo to run commands as a root user from another user. you can turn into root user in terminal sudo su command.

for your issue check whether you are running update manager or synaptic package manager.

you also can check the processes running as root using this command.

ps -u root

then kill the program using this.

sudo killall <appname> # Example: sudo killall synaptic
-2

Run sudo su it will look like this:

root@_______-Computer:~$
  • 1
    sudo su is actually double. sudo apt-get install git should work. – bigbang Jan 23 '16 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.