Ubuntu: E: Unable to locate package git



Question:

I am trying to install git, I used sudo apt-get install git command and it results:

E: Unable to locate package git  

This question have been asked by many people but not a single answer has fixed my problem, I have tried:

sudo apt-get update  sudo apt-get upgrade  

P.s: I am using ubuntu 14.04


Solution:1

You can add manually repository

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E1DD270288B4E6030699E45FA1715D88E1DF1F24  sudo su -c "echo 'deb http://ppa.launchpad.net/git-core/ppa/ubuntu trusty main' > /etc/apt/sources.list.d/git.list"    sudo apt-get update   sudo apt-get install git  


Solution:2

when you install Ubuntu package off-line usually in first of installation its cache doesn't get update so this error will occur and you have in your Ubuntu broken packages . for solution type in Terminal:

sudo apt-get install -f  

it will repair broken packages and after it you can continue.


Solution:3

the correct is sudo apt-get install git-all (though be sure to run sudo apt-get update first to make sure the package can be found)


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »