Super User is a question and answer site for computer enthusiasts and power users. 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

After messing stuff up trying to install/uninstall some plugins I hosed up vim completey. Running ubuntu server (no gui) how can I get back vim to the way it was originally installed with ubuntu (including any links).

$> sudo dpkg --get-selections ... uuid-runtime install vim-common deinstall vim-runtime deinstall vim-tiny deinstall vsftpd install ...

Hoping there's a way to just install those (and anything else that might be missing) Things that didn't work: $> apt-get install vim-full

$> dpkg --get-selections > selections $> dpkg --set-selections < selections $> aptitude reinstall '~pstandard' (after which I still see) ... uuid-runtime install vim-common deinstall vim-runtime deinstall vim-tiny deinstall vsftpd install ...

After that I still see just a049212@ubuntu-rails:~$ sudo find / -type f -iname 'vim' /usr/share/gettext/styles/po-vim.css /usr/share/man/man5/apparmor.vim.5.gz /var/cache/apt/archives/vim-common_2%3a7.2.245-2ubuntu2_i386.deb /var/cache/apt/archives/vim_2%3a7.2.245-2ubuntu2_i386.deb /var/cache/apt/archives/vim-runtime_2%3a7.2.245-2ubuntu2_all.deb /var/cache/apt/archives/vim-tiny_2%3a7.2.245-2ubuntu2_i386.deb /var/lib/dpkg/info/vim-common.postrm /var/lib/dpkg/info/vim-runtime.list /var/lib/dpkg/info/vim-tiny.list /var/lib/dpkg/info/vim-runtime.postrm /var/lib/dpkg/info/vim-common.list

share|improve this question
up vote 2 down vote accepted

Things I would try:

aptitude reinstall vim

If that doesn't work:

aptitude install vim-tiny ; aptitude purge vim ; aptitude install vim

share|improve this answer
    
+1 for using aptitude instead of apt-get – Vokuhila-Oliba Jan 9 '10 at 20:59
    
1st didn't work. The 2nd led to the solution for me. I couldn't run the 2nd as it was. I kept getting "E: Could not get lock /var/lib/dpkg/lock". When I seperated the 3 commands it worked. Here's my solution. sudo rm /var/lib/dpkg/lock sudo aptitude install vim-tiny sudo aptitude purge vim sudo aptitude install vim Thanks so much!!! – Phil Langeberg Jan 9 '10 at 21:28
    
Sorry about the single-line thing. I habitually violate the Ubuntu guidelines and type "sudo su" before doing multi-step processes that require root. – CarlF Jan 10 '10 at 3:50
    
@P.Langeberg: "Could not get lock /var/lib/dpkg/lock" means that another instance of aptitude, apt-get or dpkg is already running.Removing it helps, but you should first check that there's really no ohter aptitude etc. running. – sleske Jun 3 '10 at 18:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .