xlxh@ubuntu:~$ apt install git
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
xlxh@ubuntu:~$ sudo apt install git
[sudo] password for xlxh:
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 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.
解决方法:
sudo apt-get update
sudo apt-get upgrade
执行完上述两条命令后,再次执行git安装,即可安装成功