Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

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?

share|improve this question

marked as duplicate by Oli Mar 10 at 17:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4 Answers 4

up vote 7 down vote accepted

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)

share|improve this answer

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.

share|improve this answer

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
share|improve this answer
    
sudo su is completely unnecessary. Keep to sudo -i. –  guntbert Nov 4 '13 at 21:37

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.

share|improve this answer
    
thank you it worked :D I didn't have to type the "sudo" part of the get-apt to get it to work. –  fredghostkyle Nov 4 '13 at 2:03
1  
actually after being as a root user you don't have to type sudo –  Sudeep Acharya Nov 4 '13 at 5:58

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