解决unable to locate package
在安装了Ubuntu Server 11.10后,要安装git软件,使用命令
sudo apt-get install git
提示unable to locate package git
这是因为刚刚安装系统,没有更新软件源,使用命令更新软件包
sudo apt-get update
在更新时却提示Failed to fetch http://xxx/xxx 404 Not Found,这是因为软件源访问不到了,需要更新软件源,找到/etc/apt/sources.list,使用vi编辑,加入以下源
deb http://ubuntu.cn99.com/ubuntu/ precise main restricted universe multiverse deb http://ubuntu.cn99.com/ubuntu/ precise-updates main restricted universe multiverse deb http://ubuntu.cn99.com/ubuntu/ precise-security main restricted universe multiverse deb http://ubuntu.cn99.com/ubuntu/ precise-backports main restricted universe multiverse deb http://ubuntu.cn99.com/ubuntu-cn/ precise main restricted universe multiverse
再次执行
sudo apt-get update
更新完成后,安装软件即可
sudo apt-get install git