Apt-get在Ubuntu 12.04上找不到包`git`

Sha*_*han 13 git github ubuntu-12.04

我想在ubuntu 12.04上安装git.但是当输入命令时

sudo apt-get install git
Run Code Online (Sandbox Code Playgroud)

我收到以下消息.我已经跑过sudo apt-get update了.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package git is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  git-el

E: Package 'git' has no installation candidate
Run Code Online (Sandbox Code Playgroud)

Kon*_*udy 28

您必须安装git-core,而不是

sudo apt-get -y install git-core
Run Code Online (Sandbox Code Playgroud)

  • 加入ppa后你做过"sudo apt-get update"吗? (3认同)
  • 如果手动安装不起作用:从源文件中删除这些行并运行`sudo add-apt-repository ppa:git-core/ppa`.它也应该获取密钥.如果有帮助,请告诉我. (2认同)