Package 'vim' has no installation candidate [duplicate]

Solution 1:

The same problem occurred with me when I was trying yo install vim on my ubuntu 12.04.
I tried the following and it worked for me: -
sudo apt-get update
and after that
sudo apt-get install vim
After running these commands, it started working correctly.

Solution 2:

When you are prompted for a password after sudo command, you have to enter YOUR password not root password. From the command prompt, the username appears to be b, so b password should be supplied. Of course, this is valid only if b user is allowed to sudo (such as being a member of admin group in ubuntu).