E: Unable to locate package git - Ubuntu on EC2 E: Unable to locate package git - Ubuntu on EC2 git git

E: Unable to locate package git - Ubuntu on EC2


Update apt-get packages, run the following command:

$ apt-get update 


The mirrors still seem to be broken, but I was able to work around the issue with a dumb loop:

# stupid loop to get around ubuntu package mirror problemsfor attempt in 1 2 3; do  if [ ! -z "`which git`" ]; then    break  fi  echo "Trying to install git, attempt $attempt"  sudo apt-get update -yq --fix-missing  sudo apt-get install -yq gitdone

3 attempts is usually enough to find a working mirror.