I've just installed a LAMP appliance. But when I try to run apt-get install vim, I get a broken packages message.



The following packages have unmet dependencies:
  vim: Depends: vim-common (= 1:7.1-138+1ubuntu3.1) but 1:7.1.293-2ubuntu1 is to be installed
E: Broken packages
 Even after apt-get upgrade, I still get the same error message.
Jeremy Davis's picture

Which TKL release are you using? Sorry I can't offer any suggestions at the moment. I'll be back to help you out in a few day if someone doesn't beat me to it. In the  meantime, nano should be installed so you can use that to keep you going.

I'm using the 2009.10-2 release, since that's the only one available in ovf format.

Liraz Siri's picture

I'm guessing package management on your end is just out of sync:
# NOT apt-get upgrade
apt-get update 

I did not mention it, but I did do apt-get update (both before apt-get upgrade and after)

Liraz Siri's picture

Hmmm. I think something like this happened to me before, where the package manager state got corrupted and had to be fixed by clearing out the cached stuff. Try this:
rm -f /var/lib/apt/lists/*
apt-get update
Update: woops! This was a bug with the TurnKey repository which contains an old backported version of vim. This should be fixed in a few minutes.
Jeremy Davis's picture

It looks like the TKL repo is supplying the new version of vim-common, but it seems that it also has a later version of vim too. Unless there is an issue with the TKL vim package, for some reason it seems that your server is trying to install the standard Ubuntu version of vim, with the TKL supplied version of vim-common. According to the quick bit of research I just did, both vim & vim-common are version 1:7.1-138+1ubuntu3.1 (as supplied by the Ubuntu security repo). The versions supplied by the TKL repo are 1:7.1.293-2ubuntu1

To double check if its a problem with the TKL package, try downloading vim directly to your server and installing with dpkg (install vim-common first):

apt-get update && apt-get install vim-common
wget http://archive.turnkeylinux.org/ubuntu/pool

dpkg -i vim_1_7.1.293-2ubuntu1_i386.deb

(Not sure if this is related to your issues or not but from my Win7 machine, the vim filename is coming up as vim_1%3a7.1.293-2ubuntu1_i386.deb rather than vim_1_7.1.293-2ubuntu1_i386.deb - so you could try substituting the second underscore for %3a if the wget line doesn't work. In Win its changing it back to underscore so I'm not sure whats going on).

If that throws up an error about missing dependancies try installing them first using apt-get install and try again with dpkg. If it still complains about vim-common version then I suspect there is a bug in the TKL package.

If that works I'm not really sure whats going on. If that still doesn't work then in the meantime you could try commenting out the TKL repos from the souces.list and try apt-get update && apt-get install vim again and see what happens.

[edit: the end of the wget line was being lost so I cut it in 2, please note that it needs to be one line, ie "wget http://archive.turnkeylinux.org/ubuntu/pool/hardy/main/v/vim/vim_1_7.1.2...

Liraz Siri's picture

Thanks for reporting this. Vim really shouldn't be in TurnKey package repository. Think this might be something left over from an old, obsolete bugfix.

As soon as we remove it, this should clear up.

Alon Swartz's picture

Thanks for reporting this.

I just removed the obsolete vim versions from the archive, but unfortunately the old vim-common is pre-installed in the 2009.10-2 release, so this is what you need to do:

apt-get update
apt-get remove vim-tiny vim-common
apt-get install vim

This should solve the issue.

Add new comment