0

My os info:

uname -a
Linux mydebian 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64 GNU/Linux

There is no /usr/share/vim in the os,it is my first time(never install before) to install vim with command:

sudo apt install vim 

Now enter into vim ,type scriptnames in ex mode ,i get info:

  1: /usr/share/vim/vim81/defaults.vim
  2: /usr/share/vim/vim81/syntax/syntax.vim
  3: /usr/share/vim/vim81/syntax/synload.vim
  4: /usr/share/vim/vim81/syntax/syncolor.vim
  5: /usr/share/vim/vim81/filetype.vim
  6: /usr/share/vim/vim81/ftplugin.vim
  7: /usr/share/vim/vim81/indent.vim
  8: /usr/share/vim/vim81/plugin/getscriptPlugin.vim
  9: /usr/share/vim/vim81/plugin/gzip.vim
 10: /usr/share/vim/vim81/plugin/logiPat.vim
 11: /usr/share/vim/vim81/plugin/manpager.vim
 12: /usr/share/vim/vim81/plugin/matchparen.vim
 13: /usr/share/vim/vim81/plugin/netrwPlugin.vim
 14: /usr/share/vim/vim81/plugin/rrhelper.vim
 15: /usr/share/vim/vim81/plugin/spellfile.vim
 16: /usr/share/vim/vim81/plugin/tarPlugin.vim
 17: /usr/share/vim/vim81/plugin/tohtml.vim
 18: /usr/share/vim/vim81/plugin/vimballPlugin.vim
 19: /usr/share/vim/vim81/plugin/zipPlugin.vim

vim is installed entirely.
To remove the vim and updatedb and remove directory /usr/share/vim manually.

sudo apt remove vim
sudo updatedb
sudo rm -rf /usr/share/vim
#or
sudo apt remove vim
sudo rm -rf /usr/share/vim
sudo updatedb
#the order is un-related,i have maken the experiment.

Now install vim the same way as first time to do:

sudo apt install vim

Enter into vim and type :scriptnames in ex mode,i get nothing shown.

ls  /usr/share/vim 
ls: cannot access '/usr/share/vim': No such file or directory

vim is installed partly.
As duthils point out in the webpage
fix the issue
apt install --reinstall vim-runtime can fix the issue.
Yes!I have verified that for the second time installation (after to remove the vim and updatedb and remove directory /usr/share/vim manually)

sudo apt install vim
sudo apt install --reinstall vim-runtime    

Or

sudo apt install vim-runtime vim

In the explanation:It seems that your directory /usr/share/vim was manually deleted (it is "not found" but still referenced by your original locate),it is true in my case,why updatedb can't cancel the reference by locate?How to cancel the reference properly by locate? I want a pure functional way,same input same output,it is unacceptable to install same package vim with two different commands.

showkey
  • 89
  • 4
  • 16
  • 40
  • How is this post different from your [other post](https://superuser.com/questions/1625085/why-installed-part-of-vim-instead-of-entire-diectories)? – harrymc Feb 14 '21 at 11:35
  • Why updatedb can't cancel the reference by locate?How to cancel the reference properly by locate? – showkey Feb 14 '21 at 11:46
  • `duthils` help me to install `vim` ,but i want a way to fix the package management system. – showkey Feb 14 '21 at 11:50
  • Why `sudo updatedb` can't restore my os into previous status? – showkey Feb 14 '21 at 11:51

1 Answers1

0

To regenerate the database of locate, you could try to rename the current database and call again updatedb.

To find the database, run man updatedb. This information can be found under "Files".
Mine says: /var/lib/mlocate/mlocate.db.

If this works, you may delete the renamed file.

harrymc
  • 455,459
  • 31
  • 526
  • 924
  • The directory is /var/cache/locate/locatedb in my debian,it is no use to remove and regenerate and then install vim second time only with such command as `sudo apt install vim`. – showkey Feb 15 '21 at 01:34
  • You should regenerate the database after you have installed everything. This will take some time. – harrymc Feb 15 '21 at 07:41