Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I installed ubuntu inside windows 7 using VMware. I wanted to execute a c program in ubuntu.

when I tried I got like this,

b@ubuntu:~/examples$ vim a.c
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>
b@ubuntu:~/examples$ sudo apt-get install vim
[sudo] password for b:
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 obseleted, or 
is only available from another source

E: Package 'vim' has no installation candidate
I tried apt-get install vim

E: Could not open lock file /var/lib/dpkg/lock - open (13:Permission denied)
E:unable to lock the administration directory (/var/lib/dpkg/), are you root?

when I tried to do su it asked me for a password . When I typed the root password its not accepting it and says "Authentication Failure"

I could not install the Vim package. Is there any way I can install it? Please suggest me. How do I regain my root paswword.

share|improve this question

migrated from Feb 6 '12 at 9:11

This question came from our site for system and network administrators.

marked as duplicate by Avinash Raj, karel, guntbert, minerz029, mikewhatever Jan 18 '14 at 6:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

paste your /etc/apt/sources.list as it may be corrupted. – Jure1873 Feb 5 '12 at 10:34
And run apt-get update and look for any errors while you're at it. – Shane Madden Feb 5 '12 at 18:29
@Shane MAdden: After giving the command apt-get update i'm getting the following errors Reading package lists... header E:Encountered a section with no package: header E:Problem with mergelist /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_maverick_universe_binary-i‌​386_Packages E:The package lists or status file could not be parsed or opened. – Angus Feb 7 '12 at 10:48
What Ubuntu version are you using? – Lekensteyn Feb 11 '12 at 18:17

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).

share|improve this answer
I tried as u said but its not taking the password i typed. when i installed ubuntu in vmware all i gave was only one password. and now its not letting me to login as root also. Is there a way to change the root password. – Angus Feb 5 '12 at 11:52
The root account is disabled by default in Ubuntu. When you installed you should have created a regular user account (e.g. 'jsmith'). That account will have rights to run programs via sudo (with jsmith's password, not root's). – Jim G. Feb 5 '12 at 20:11

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.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.