英文版Ubuntu
今日,刚在Vmware上装上Ubuntu10.04,想试一下流行的Vim编辑器写个c程序,结果输入vim,来了个:
The program vim can be found in the following package:
vim
vim -gnome
vim-tiny
vim-gtk
vim-nox
Try:sudo apt-get install <select package>
上面这些信息估计就是提示:vim还没有安装,且vim的安装包已经有了,在列出的这些包里,你可以用sudo apt-get install vim 命令来安装,
然后,我就输入 sudo apt-get install vim,结果又出现以下提示:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package vim 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 vim has no installation candidate
Google一下,发现好像是缺少某些包,要更新软件源。解决方法如下:
把/etc/apt/sources.list 里的软件源列表修改一下。
步骤:
首先,安全起见,先备份一下要修改的文件。命令:cp -i /etc/apt/sources.list /etc/apt/sources.list_backup
然后,打开sources.list, 看他们是用nano编辑器打开的,我也就照搬了,命令:nano /etc/apt/sources.list
打开之后,去掉以下两行的注释就可以了(文件可能会不大一样,可以根据自己的情况看这个网页的说明http://ubuntuguide.org/wiki/Ubuntu:Lucid#Add_Extra_Repositories):
deb http://cn.archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse
修改完后,按Ctrl+X 退出。
然后,更新一下。 命令:sudo apt-get update
更新后,再执行 sudo apt-get vim, 系统就会自动下载缺少的包,然后vim就可以顺利安装了。