详情如下:
ubuntu@ubuntu:~$ sudo apt-get install vim
[sudo] password for ubuntu:
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
解决方法:
sudo apt-get update
sudo apt-get install vim
最后我们可以通过命令:echo $? 输出结果是否为0,来判断软件是否安装成功。
如果返回结果是0,表示软件成功安装。
如果返回结果是非0,表示软件安装过程中出现问题。