无法在 debian9 (stretch) 上安装 git

无法在 debian9 (stretch) 上安装 git

我想在我的 debian 9 (stretch) 机器上安装 git,当我输入:

sudo apt install git-all

我收到这条消息:

Reading package lists... Done

Building dependency tree        Reading state information... Done Some `packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The followi`ng information may help to resolve the situation:

The following packages have unmet dependencies:

 git-all : Depends: git (> 1:2.25.0) but it is not going to be installed
           Depends: git (< 1:2.25.0-.) but it is not going to be installed
           Depends: git-el but it is not going to be installed
           Depends: git-cvs but it is not going to be installed
           Depends: git-mediawiki but it is not going to be installed
           Depends: git-svn but it is not going to be installed
           Depends: git-email but it is not going to be installed
           Depends: git-gui but it is not going to be installed
           Depends: gitk but it is not going to be installed
           Depends: gitweb but it is not going to be installed
           Recommends: git-daemon-run but it is not going to be installed or
                       git-daemon-sysvinit but it is not going to be installed
E: Unable to correct problems, you have held broken packages

任何帮助,提前致谢

编辑

当我输入时什么也没有发生:

sudo dpkg --configure -a

该命令的结果:

sudo apt update && sudo apt upgrade

这是一条消息:

Hit:1 http://security.debian.org stretch/updates InRelease                                                                                           
Ign:2 http://deb.debian.org/debian stretch InRelease                                                                                                 
Ign:3 http://httpredir.debian.org/debian stretch InRelease                                                                                           
Hit:4 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease                                                                                   
Hit:5 http://deb.debian.org/debian stretch-updates InRelease                                                                                         
Ign:6 http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.0 InRelease                                                                           
Hit:7 http://httpredir.debian.org/debian stretch Release                                                                                             
Hit:8 http://repository.spotify.com stable InRelease                                                                                                 
Hit:9 http://deb.debian.org/debian stretch Release                                                                                        
Hit:12 http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.0 Release                                           
Hit:13 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial InRelease 
Hit:16 http://ppa.launchpad.net/webupd8team/java/ubuntu bionic InRelease
Get:17 https://dl.yarnpkg.com/debian stable InRelease [17.1 kB]                
Get:18 https://deb.nodesource.com/node_9.x stretch InRelease [4,623 B]
Hit:19 http://ppa.launchpad.net/webupd8team/java/ubuntu cosmic InRelease                                                                             
Hit:20 https://repo.skype.com/deb stable InRelease                                                                                                   
Ign:10 https://get.docker.com/ubuntu docker InRelease                                                                                                
Get:21 https://get.docker.com/ubuntu docker Release [1,525 B]
Get:22 https://get.docker.com/ubuntu docker Release.gpg [473 B]
Ign:22 https://get.docker.com/ubuntu docker Release.gpg
Reading package lists... Done   
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list.d/base.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list.d/base.list:1
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list.d/base.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list.d/base.list:1
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list.d/base.list:1
W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list.d/base.list:1
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list.d/base.list:1
W: GPG error: https://get.docker.com/ubuntu docker Release: The following signatures were invalid: 36A1D7869245C8950F966E92D8576A8BA88D21E9
E: The repository 'http://get.docker.io/ubuntu docker Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list.d/base.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list.d/base.list:1
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list.d/base.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list.d/base.list:1
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list.d/base.list:1
W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list.d/base.list:1
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:18 and /etc/apt/sources.list.d/base.list:1

答案1

问题是这样的:

http://ppa.launchpad.net/git-core/ppa/ubuntu focal

您无法在 Debian 9 上使用 Ubuntu 焦点 PPA。从您的配置中删除它,您将能够安装 git。

你可能也不需要git-all

sudo apt install git

应该足够了。

相关内容