尝试使用 apt-get 安装 GIT 但失败。
所有的网络搜索都会出现不同的命令,但似乎都没有用。
安装命令的输出
sudo apt-get install apt-transport-https ca-certificates git curl gnupg -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
curl is already the newest version (7.81.0-1ubuntu1.4).
gnupg is already the newest version (2.2.27-3ubuntu2.1).
gnupg set to manually installed.
ca-certificates is already the newest version (20211016).
ca-certificates set to manually installed.
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 following information may help to resolve the situation:
The following packages have unmet dependencies:
git : Depends: liberror-perl but it is not installable
E: Unable to correct problems, you have held broken packages.
请注意这是在 VirtualBox 中运行的,但我不认为这会影响结果?
任何帮助将不胜感激
答案1
首先尝试启用多元宇宙仓库:Software & Updates
您的应用菜单中应该有一个应用,其中有一个名为 Ubuntu 软件的选项卡。打开它,检查多元宇宙和受限选项是否被选中。当您修改它们时,它应该会提示您输入密码。完成后,关闭窗口并执行sudo bash -c 'dpkg --configure -a && apt update && apt upgrade'
。完成后,尝试再次安装 git,它应该可以工作。