Vim version changes without opening a new terminal, without restarting the computer. Simply, the next day my computer takes the repo version, which has been removed by apt before.
I've compiled vim from the source, because I needed some options, which is not compiled in the repo version. I've done it a few times before, but now on XUbuntu 18.04LTS the system forgets the compiled vim and somehow it pulls back the repo version, what I removed, at least I thought that.
After being unsure whether I do the compilation and the post-compile setup correctly, I was following this link. I've also used checkinstall and last time I pulled vim8.2 back with dpkg -i deb_name
, where deb_name is the name of the deb file checkinstall created.
I noticed, that when the compiled vim version is not recognized, the location where it was installed is also not available:
~ $ sudo update-alternatives --install /usr/bin/editor editor /usr/local/bin/vim 1
update-alternatives: error: alternative path /usr/local/bin/vim doesn't exist
~ $ ls -l /usr/local/bin/ | grep vi
lrwxrwxrwx 1 root root 3 Mär 13 2018 ex -> vim
-rwxr-xr-x 1 root root 216 Feb 15 2019 pyvisa-info
-rwxr-xr-x 1 root root 218 Feb 15 2019 pyvisa-shell
lrwxrwxrwx 1 root root 3 Mär 13 2018 rview -> vim
lrwxrwxrwx 1 root root 3 Mär 13 2018 rvim -> vim
lrwxrwxrwx 1 root root 3 Mär 13 2018 view -> vim
lrwxrwxrwx 1 root root 3 Mär 13 2018 vimdiff -> vim
This is really strange, since I needed to execute this command to tell my system, where vim was compiled.
The location is on a local drive, the whole /usr
is one logical volume, so it can not be disconnected.
I have removed vim with sudo apt remove vim vim-runtime gvim vim-common
ebefore compiling. dpkg -l | grep vim
has confirmed that I have no vim package installed. Also the shell tells me, that Command 'vim' not found
. Although some time later - next day - vim is there again from the repo:
~ $ dpkg -l vim
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-====================================-=======================-=======================-========================================================
ii vim 2:8.0.1453-1ubuntu1.4 amd64 Vi IMproved - enhanced vi editor
Installing the deb created by checkinstall solves the issue for about a day:
~/git_repos/vim $ sudo dpkg -i vim_20201104-1_amd64.deb
[sudo] password for tibenszky:
dpkg: warning: downgrading vim from 2:8.0.1453-1ubuntu1.4 to 20201104-1
(Reading database ... 487461 files and directories currently installed.)
Preparing to unpack vim_20201104-1_amd64.deb ...
Unpacking vim (20201104-1) over (2:8.0.1453-1ubuntu1.4) ...
Setting up vim (20201104-1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
I have no clue what could have cause this issue, or how could I debug and solve this. Any help is appreciated.
Update:
It seems like that apt's daily upgrade overwrite my vim version. So the question is changed to 'How do I tell apt that I want to use my compiled version, and not the repo version?'. I've just issues the command sudo apt-mark hold vim
and hopefully tomorrow vim will not be updated again. I've found the command in this question.
grep -i apt /var/log/syslog
please. Have you got an automated job that updated your system for you? – roaima Nov 9 '20 at 10:50