每当我尝试执行 vim 时,终端都会显示以下内容:可以在以下软件包中找到程序“vim”:
* vim
* vim-gnome
* vim-tiny
* vim-athena
* vim-gtk
* vim-nox
Try: sudo apt-get install <selected package>
于是我尝试了大多数同学做过的事情,sudo apt-get update
但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
谢谢你的回答
答案1
在安装 vim 之前尝试这样做sudo apt-get update && sudo apt-get upgrade
。有时未升级的软件包会搞乱其他软件包的安装。
答案2
尝试这个
sudo apt-get update
sudo apt-get install vim-common
答案3
该消息告诉您 vim 命令在不同的编译二进制包版本中可用。请尝试sudo apt-get install vim-gnome
。
askubuntu.com -vim-gtk 和 vim-gnome 之间的区别