ubuntu12.04无法安装git的问题

坚强是说给别人听的谎言 提交于 2019-12-08 15:04:33

在刚安装的ubuntu下安装git会出现各种问题,通过查找资料,发现网上有两种安装方式,但都遇到了问题,现在就写一下自己的安装过程和遇到的问题


方法一:通过下载git包进行安装

首先是下载git包

# wget http://www.kernel.org/pub/software/scm/git/git-1.8.2.3.tar.gz

然后解压安装时发现网上教程中的都行不通,缺了很多包,不是缺这就是缺那,所以放弃这个方法


方法二:通过更新后安装(安装成功)

首先是

#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



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!