解决Ubuntu17.04不能安装git的问题 E: Package 'git' has no installation candidate

解决Ubuntu17.04不能安装git的问题 E: Package 'git' has no installation candidate

    在Ubuntu系统中安装git的命令是:sudo apt install git,但比较奇怪的是,在Ubuntu17.04中输入该命令,却出现以下的情况:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package git is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'git' has no installation candidate


    没有找到对应软件包'git',Why?以为没有update,但输入apt-get update,还是出现这种问题。后来,发现是更改一下Install的源地址就可以了,方法是:在System settings->software&Updates,勾选“Source code”,在Download from选择other


oftware&Updates,勾选“Source code”,在Download from选择other


点击选择“select Best Server”会自动选择网络最好的服务器,当然或者选择mirror.aliyun.com等国内镜像服务器下载。


然后Choose Server->Close->Reload即可,最后再次输入“sudo apt install git”就可以正常安装git了



猜你喜欢

转载自blog.csdn.net/guyuealian/article/details/80833986