Debian 8 - 无法安装 Git

Debian 8 - 无法安装 Git

我正在尝试使用以下命令安装 Git:

sudo apt-get install git-core

sudo apt-get install git

两者似乎都不起作用。好像有些包找不到。这是两个命令的结果: 在此输入图像描述

我的来源列表:

# deb http://ftp.de.debian.org/debian jessie main

deb http://ftp.de.debian.org/debian jessie main non-free contrib
deb-src http://ftp.de.debian.org/debian jessie main non-free contrib

deb http://old-releases.debian.org/ jessie/updates main contrib non-free
deb-src http://old-releases.debian.org/ jessie/updates main contrib non-free

# jessie-updates, previously known as 'volatile'
deb http://ftp.de.debian.org/debian jessie-updates main contrib non-free
deb-src http://ftp.de.debian.org/debian jessie-updates main contrib non-free

deb http://ftp.debian.org/debian jessie-backports main

deb http://mirrors.digitalocean.com/debian jessie main contrib non-free
deb-src http://mirrors.digitalocean.com/debian jessie main contrib non-free

# jessie-updates, previously known as 'volatile'
deb http://mirrors.digitalocean.com/debian jessie-updates main contrib non-free
deb-src http://mirrors.digitalocean.com/debian jessie-updates main contrib non-free

deb http://packages.dotdeb.org jessie all
deb-src http://packages.dotdeb.org jessie all

deb http://ftp.debian.org/debian stretch-backports main
deb-src http://ftp.debian.org/debian stretch-backports main

我的 Linux 版本:Debian GNU/Linux 8 (jessie)

Git 的正确包 URL 是什么?

答案1

删除sources.list中的所有行并添加以下行

deb http://ftp.us.debian.org/debian/ jessie main contrib non-free deb-src http://ftp.us.debian.org/debian/ jessie main contrib non-free

别忘了apt-get update

答案2

jessie-backports存储库不再存在,并且包含用于扩展的包。由于当前的分布已经很长,您有两种选择:

  • 禁用 jessie-backports,运行apt-get update并从中获取 git 包杰西( apt-get install git)、stretch(当前不在您的sources.list 中)或stretch-backports ( apt-get install -t stretch-backports git)
  • 升级为拉伸

相关内容