在Ubuntu 18.04.2LTS中安装git时显示错误

ekqde3dh  于 2023-11-17  发布在  Git
关注(0)|答案(4)|浏览(215)

我正在尝试通过命令安装git。

sudo apt install git

字符串
显示错误:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 git : Depends: liberror-perl but it is not going to be installed
       Depends: git-man (> 1:2.17.1) but it is not going to be installed
       Depends: git-man (< 1:2.17.1-.) but it is not going to be installed
 mongodb-org : Depends: mongodb-org-server but it is not going to be installed
               Depends: mongodb-org-mongos but it is not going to be installed
               Depends: mongodb-org-tools but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).


此外,尝试运行命令apt --fix-broken install,但没有工作。

ljo96ir5

ljo96ir51#

我认为你需要看看那里:我使用ubuntu 20.04,但它为我运行。

https://linuxize.com/post/how-to-install-git-on-ubuntu-18-04/

字符串

mzaanser

mzaanser2#

尝试先用sudo apt-get upgrade更新所有现有的软件包。之后你可能想运行sudo apt-get autoclean。最后再尝试安装一次git sudo apt-get install git

oug3syen

oug3syen3#

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git

字符串

vjrehmav

vjrehmav4#

这对我来说很有效:

sudo add-apt-repository main
sudo apt update

字符串
From:https://ubuntuforums.org/showthread.php?t=2454450

相关问题