git安装失败

回答一:通过更新后安装(安装成功)

首先是

#sudo apt-get update

更新到后面会遇到这个问题

 W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used.GPG error: http://security.ubuntu.com lucid-security Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key

……
这时进行安装git
#sudo apt-get install git
会出问题:git:depends:liberror-perl but it is not installable
发现还是缺少包,就是更新不完全
解决方案
#sudo apt-get clean 
#cd /var/lib/apt 
#sudo mv lists lists.old 
#sudo mkdir -p lists/partial 
#sudo apt-get clean 
#sudo apt-get update
这时再安装就可以成功了
#sudo apt-get install git
 
 
另一个回答:

试一下如下命令:

 sudo apt-get update  
sudo apt-get upgrade
sudo apt-get install -f 
posted @ 2018-02-02 03:20  sanjor_ch  阅读(936)  评论(0)    收藏  举报