-2

whenever i type apt-get install git then it show error... error displayed by terminal is

 yogesh@yogesh-dell:~$ apt-get install git
    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?
Pilot6
  • 88,764
  • 91
  • 205
  • 313
  • 3
    sudo apt-get install git – xangua Aug 17 '15 at 17:37
  • 1
    @Pilot6 WRONG! The two error messages: from the one you referenced: `E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)` and from this one `(13: Permission denied)` have both a different error code (11 != 13) but different messages. They are different errors. – waltinator Aug 17 '15 at 18:31
  • @waltinator I agree. – Pilot6 Aug 17 '15 at 19:20

1 Answers1

2

The error messages tells you exactly what is wrong: E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?.

Either use the Software Center, or the sudo command. Read man sudo, then try:

sudo apt-get install git  
waltinator
  • 35,099
  • 19
  • 57
  • 93
  • how to solve the lock administration directory problem – Joshi Yogesh Aug 17 '15 at 18:15
  • The directory `/var/lib/dpkg` is writable (so one can create `lock`) only by `root`. It, too, will be resolved correctly by my by either half of my answer. – waltinator Aug 17 '15 at 18:19
  • i tried sudo too . but it wasn't able to downloaded git terminal. sudo showed authentication problem. at last showed successfully installed but there isn't any git terminal in my lappy – Joshi Yogesh Aug 17 '15 at 18:20
  • What is a "git terminal"? What do the terminal commands `type -p git`, `man git` and `dpkg -L git` show? – waltinator Aug 17 '15 at 18:23
  • /usr/bin/git shown by first command – Joshi Yogesh Aug 17 '15 at 18:31
  • 1
    Therefore you have installed `git`. Now go search the internet for git How-To, and do `man -k git` and read those `man` pages. – waltinator Aug 17 '15 at 18:34
  • To use the `git` client, read `man git`, `man git-clone` and other pages to find out what you need - genrally you can use the `git` command in the terminal etc, you don't need a special terminal for it. If you are using a git based SCM, they may have documentation which will tell you how to use `git` as well - e.g. https://help.github.com/ . There are also GUI clients available: http://askubuntu.com/q/227554/178596 – Wilf Aug 17 '15 at 19:06
  • BTW, "sudo showed authentication problem" can be only seen as "I mistyped my password" (happens to us all), but when that happens, `sudo` does not do anything, so reporting it does not help. – waltinator Aug 17 '15 at 20:01