Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am running Ubuntu 13.04 and I assumed that vim comes by default. There is a /etc/vim on my system (assuming it refers to the same thing). However, I was unable to do a vim abc.txt. Instead, I got a reply stating that vim is not recognized. Please refer to the following and provide me a solution.

rahul@hpdv6:~/Downloads/VIM/vim64/src$ 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
rahul@hpdv6:~/Downloads/VIM/vim64/src$ 

Thanks in advance.

share|improve this question
    
Hi belacqua, apt-cache search ^vim shows nothing. –  Rahul Rajaram May 10 '13 at 23:56
    
I do, but the letters 'v', 'i' and 'm' are in red. Is that a concern ? –  Rahul Rajaram May 11 '13 at 0:01
    
I get the following message - rahul@hpdv6:/usr/bin$ /usr/bin/vim abc.txt bash: /usr/bin/vim: Too many levels of symbolic links –  Rahul Rajaram May 11 '13 at 0:07
    
The command does not seem to recognize vim. rahul@hpdv6:/usr/bin$ sudo update-alternatives --config editor There are 2 choices for the alternative editor (providing /usr/bin/editor). Selection Path Priority Status ------------------------------------------------------------ * 0 /bin/nano 40 auto mode 1 /bin/ed -100 manual mode 2 /bin/nano 40 manual mode Press enter to keep the current choice[*], or type selection number: –  Rahul Rajaram May 11 '13 at 0:11
    
I just did a sudo apt-get install linux-doc and that seems to work. –  Rahul Rajaram May 11 '13 at 0:26
show 2 more comments

3 Answers 3

Vim should be installed by default on all machines. As well, that command should work just fine. You may want to try these:

sudo apt-get install vim-tiny

for the command line mode or:

sudo apt-get install vim-gnome

for the full GUI edition.

share|improve this answer
    
Hi llamositopia, I have tried all possible alternatives. It does not seem to work. –  Rahul Rajaram May 10 '13 at 23:39
    
Have you tried using sudo apt-get remove vim followed by sudo apt-get install vim it may be a problem with the current installation not showing up. –  llamositopia May 11 '13 at 0:01
    
I did that too. Infact, I believe I am having the same problem with the g++ package. –  Rahul Rajaram May 11 '13 at 0:02
add comment

You must not have the source enabled. This link will open it in the software center: http://apt.ubuntu.com/p/vim

If you need to enable the source it will give you a button

It shows up for me.

share|improve this answer
    
Hi GM-Script-Writer-62850, I understand that it should show up, but it doesn't. –  Rahul Rajaram May 10 '13 at 23:39
    
can you post your /etc/apt/sources.list file? tried running sudo apt-get update? –  GM-Script-Writer-62850 May 11 '13 at 0:18
    
I get the following message when I run the former: rahul@hpdv6:/usr/bin$ sudo /etc/apt/sources.list sudo: /etc/apt/sources.list: command not found –  Rahul Rajaram May 11 '13 at 0:27
    
Yes, I tried running sudo apt-get update. –  Rahul Rajaram May 11 '13 at 0:27
    
cat /etc/apt/sources.list it is not a script is a config file –  GM-Script-Writer-62850 May 11 '13 at 1:01
show 7 more comments

What does apt-cache search ^vim show?

What happens if you run /usr/bin/vim abc.txt ?

I'm guessing you or someone did something odd with the system (installs or package removals, or file deletion).

Try
sudo update-alternatives --config editor

If that doesn't work, are you able to install any other packages? E.g., sudo apt-get install tidy or anything else?

Try the steps in this answer .

share|improve this answer
    
I just tried sudo apt-get install linux-doc, and that worked fine. I think I have probably done something funny. –  Rahul Rajaram May 11 '13 at 0:46
    
Yeah, I'm concerned that you might have gotten other things deleted or moved around. You might post the contents of your /etc/apt/sources.list file to see if there's anything odd there. –  belacqua May 11 '13 at 1:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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