Unmet dependencies while installing Git on Debian
Solution 1
You should edit your sources.list , by adding the following line:
deb http://ftp.ca.debian.org/debian/ jessie main contrib
Then upgrade your package and install git
:
apt-get update && apt-get upgrade && apt-get dist-upgrade
apt-get -f install
apt-get install git
Edit
the following package git
, liberror-perl
and [rsync
]3 can be downloaded from the main
repo , because you don't have the main
repo on your sources.list
you cannot install git
and its dependencies .
Your sources.list
should be (with non-free
packages):
deb http://ftp.ca.debian.org/debian/ jessie main contrib non-free
deb-src http://ftp.ca.debian.org/debian/ jessie main contrib non-free
deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free
deb http://ftp.ca.debian.org/debian/ jessie-updates main contrib non-free
deb-src http://ftp.ca.debian.org/debian/ jessie-updates main contrib non-free
deb http://ftp.ca.debian.org/debian/ jessie-backports main contrib non-free
On debian Stretch your /etc/apt/sources.list
should be (at least):
deb http://deb.debian.org/debian stretch main
deb http://security.debian.org/ stretch/updates main
deb http://deb.debian.org/debian/ stretch-updates main
Solution 2
Try apt-get update && apt-get install git-core
.
I found it in here.
Solution 3
sudo apt-get purge mongodb mongodb-server mongodb-server-core mongodb-clients sudo apt-get purge mongodb-org sudo apt-get autoremove
Use this code. It is working.
Related videos on Youtube
DevonRyder
Updated on September 18, 2022Comments
-
DevonRyder over 1 year
I am attempting to install git on
Debian 8.6 Jessie
and have run into some dependency issues. What's odd is that I didn't have any issues the few times I recently installedGit
in a VM while I was getting used to Linux.apt-get install git
Results in:
The following packages have unmet dependencies: git : Depends: liberror-perl but is not installable Recommends: rsync but it is not installable E: Unable to correct problems, you have held broken packages.
UPDATE
my
sources.list
Seems to be an issue with my system. I can no longer properly install anything. I'm getting dependency issues installing things like
Pulseaudio
which I've previously installed successfully a few days ago.-
phk over 7 yearsTry
sudo apt -f install
orsudo aptitude -f
. -
DevonRyder over 7 years@phk 0 packages installed
-
GAD3R over 7 yearsRun
apt-get dist-upgrade && apt-get install git
-
GAD3R over 7 yearsPlease edit here by adding the output of
cat /etc/apt/sources.list
-
DevonRyder over 7 years@GAD3R Okay, sorry, I've added the scrot now.
-
-
Bigon over 7 yearsThe
git-core
package is just a transitional package which unique function is to pull thegit
package. -
DevonRyder over 7 years@sidahmed I too saw this link earlier. However, I get the error
git-core : Depends: git (> 1:1.7.0.2) but is not going to be installed
. -
Sidahmed over 7 yearsI know that this may be obvious, but did you use
apt-get update
?? -
DevonRyder over 7 years@Sidahmed Indeed.
-
Sidahmed over 7 yearsokay, clean all the cache with this two commands
sudo apt-get clean
andsudo rm -r /var/lib/apt/lists/*
. Then reuse the command in the answer. -
DevonRyder over 7 yearsI already have that in the image, no? Also, it seems to be a new issue with my system. I get a similar unmet dependencies message when tryin to install anything now.
-
GAD3R over 7 yearsNo ! You have the
deb-src
on yoursources.list
-
DevonRyder over 7 yearsAlright, I'll take a look shortly. Why would this cause all these dependency issues while installing any packages though when it worked before?
-
DevonRyder over 7 yearsOkay, it's worked now, thanks. What's the difference with the deb source at the bottom VS at the top? Do you just prefer to add backports separate? Also, is it normally advised to use
non-free
andcontrib
with security updates? -
GAD3R over 7 yearsthe
deb-src
is used to download the source code of a program , thedeb
is used to install the program. You can move backports source to the top , it is not a problem . Yes you should use the security update withnon-free
sources -
Parsa almost 6 years@GAD3R for debian 9 we should also add the following link that you wrote , to our sources list or another link ??
-
GAD3R almost 6 years@Parsa I have update my answer.
-
WitnessTruth about 5 yearsThis is bad for Ubuntu. A simple git installation we have to follow all these steps to simply install a git.
-
GAD3R about 5 years@WitnessTruth This answer is valid for only for Debian. On Ubuntu you should have main , update and security components enabled on your sources.list. You can ask a question to if you have a problem with git installation to get a detailed answer , and you are welcome.
-
WitnessTruth about 5 years@GAD3R. Thank you for the answer. I understand your point. However, when I read this answer I was using Ubuntu and I had the exaclty same problem in Ubuntu 18.04 ... :/ Unfortunately...
-
GAD3R about 5 years@WitnessTruth There is a sample sources.list on AskUbuntu , exclude the
bionic-backports
, just you need the first 3 lines, Then update and install git. Make sure to have only the 3 lines ( that's why it is hard to answer in a comment without knowing the current sources configuration. Because a duplicate url may cause a problem) -
RalfFriedl over 4 yearsCan you explain what the steps do?
-
Hamdambek over 4 yearsRalfFriedl you can use above explanation content. What is exactly issues in your system.
-
Jeremy Boden over 2 yearsSo the solution is to install some Ubuntu stuff on top of Debian? Good luck with that.