2

I followed these instructions from YouCompleteMe to build Vim from source: https://github.com/ycm-core/YouCompleteMe/wiki/Building-Vim-from-source

It worked. But now, every time I reboot the computer, the old version of Vim reinstalls itself, even though I run apt uninstall vim every time. This involves going to the directory with the .deb file, running apt install ./vim_20201226-1_amd64.deb , and then running hash vim. How do I avoid doing this every time my computer boots?

Also, dpkg gives me a warning every time I install the upgraded version of Vim: dpkg: warning: downgrading vim from 2:8.1.0875-5 to 20201226-1. This is not true: I'm upgrading Vim to 8.2.2223, since YouCompleteMe requires at least v8.1.2269.

I am running Debian Buster.

2 Answers 2

2

apt will try to upgrade vim because the available version in debian repositories is more recent than the installed version through dpkg.

To prevent apt from upgrading a single package vim, you can use:

sudo apt-mark hold vim

man apt-mark:

hold
   hold is used to mark a package as held back, which will prevent the package from being
   automatically installed, upgraded or removed.
2
  • Thank you. Why does apt think that I'm downgrading Vim, even though I'm actually upgrading it? Dec 30, 2020 at 19:42
  • 1
    The 2 before the colon is an epoch, which means that the version number has changed incompatibly. Any version with a higher epoch is greater than one with a lower epoch, and a missing epoch is 0. So you're downgrading because 20201226-1 has epoch 0, and 2:8.1.0875-5 is greater because it has epoch 2.
    – bk2204
    Dec 30, 2020 at 22:57
2

I believe the warning may be just a warning, and is wrong :

dpkg: warning: downgrading vim from 2:8.1.0875-5 to 20201226-1

In ascii, ":" is decimal 58, "0" is decimal 48.

So if the packaging compares version by cutting the version string at each "." or "-", a string starting with "2:" will be considered "higher" (thus a "more recent" version) than one starting with "20"

It seems the packaging system correctly update to the latest version 20201226-1 (maybe because it uses another mechanism to check which version is more recent, for exemple its publication date?), but when doing the upgrade, the packaging system announces the change by comparing the versions by their "alphabetical order", and consider that going from "2:8.1.0875-5" to "20201226-1" is a "downgrade" (even though it's not: you are in fact updating vim to the latest packaged version)

The version it installs should cover your requirements (it is more recent than the version you manually installed), unless you need to modify the source for your use case? (or unless something also thinks that this new version is "lower" than the required one, due to the same lexographical comparison?)

You must log in to answer this question.

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