从 debian wheezy backports 安装 git:无论如何我看到旧的包版本

ava*_*sin 2 debian aptitude git apt debian-wheezy

我需要安装 git 1.8.* 版本。

  1. 我将向后移植添加到我的 sources.list 中;
  2. 通过apt-get remove git;删除当前安装的 git
  3. 执行apt-get update以更新我的包列表
  4. aptitude show git 仍然显示 Version: 1:1.7.10.4-1+wheezy1

我在做什么错?

这是我的 /etc/apt/sources.list:

deb http://ftp.de.debian.org/debian/ wheezy main
deb-src http://ftp.de.debian.org/debian/ wheezy main

deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main

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

# deb multimedia
deb http://www.deb-multimedia.org wheezy main non-free

# wheezy backpors
deb http://ftp.de.debian.org/debian wheezy-backports main
Run Code Online (Sandbox Code Playgroud)

PS我也尝试执行apt-get install git --reinstall,但没有效果-版本仍然是1.7

PPS 是的,我确定它应该是 1.8。在向后移植:http : //packages.debian.org/wheezy-backports/git

Bra*_*iam 7

Backport 存储库的优先级低于 main/updates/security 存储库。您可以通过多种方式安装它:

sudo apt-get install git/wheezy-backports
sudo apt-get -t wheezy-backports install git
Run Code Online (Sandbox Code Playgroud)

修改 apt.conf 并添加以下行:

APT::Default-Release "wheezy-backports";
Run Code Online (Sandbox Code Playgroud)

或者在首选项文件中:

Package: git
Pin: origin release a=wheezy-backports
Pin-Priority: 990
Run Code Online (Sandbox Code Playgroud)