The program 'vim' can be found in the following packages:
* vim
* vim-gnome
* vim-tiny
* vim-gtk
* vim-nox
Try: sudo apt-get install <selected 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編輯器開啟的,我也就照搬了,命令:sudo nano /etc/apt/sources.list
開啟之後,可以根據自己的情況看這個網頁的說明
http://ubuntuguide.org/wiki/Ubuntu:Lucid#Add_Extra_Repositories
修改,按Ctrl+X 退出。
然後,更新一下。 命令:sudo apt-get update
更新後,再執行 sudo apt-get install vim, 系統就會自動下載缺少的包,然後vim就可以順利安裝了。