2

I find that part of vim installed with the command:

sudo apt install vim

Check all directories whose path contain vim.

sudo find / -name  vim
/etc/alternatives/vim
/etc/vim
/var/lib/dpkg/alternatives/vim
/usr/share/bug/vim
/usr/share/cmake-3.13/editors/vim
/usr/share/lintian/overrides/vim
/usr/share/doc/vim
/usr/bin/vim

There are no such directory as vim/vim81,vim/vim81/autoload. And i got contracdictive info on my os:

vim  --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun 15 2019 16:41:15)

1.scriptnames

Enter into vim and type :scriptnames in ex mode,nothing shown!

2.locate

locate vim81 |grep autoload
/usr/share/vim/vim81/autoload
/usr/share/vim/vim81/autoload/README.txt
/usr/share/vim/vim81/autoload/RstFold.vim
/usr/share/vim/vim81/autoload/ada.vim

3.ls

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

I don't prefer vim82 to vim81,satisfied with any version of them,i am sad that none of them can work after my installation.
What is the matter for my installation?

sudo updatedb
sudo apt remove vim
sudo apt install vim
locate vim81
Nothing output
locate vim82
Nothing output

Still can't installed. Do as @harrymc say :

uname -a
Linux mydebian 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64 GNU/Linux
sudo apt-get update
sudo apt-get install vim vim-gtk3
sudo updatedb

Now to check vim81 or vim82:

locate vim81
locate vim82

They output nothing,i enter into vim ,scriptnames show nothing.

sudo find /  -name 'vim'  
/etc/alternatives/vim
/etc/vim
/var/lib/dpkg/alternatives/vim
/home/debian/nginx/contrib/vim
/usr/share/bug/vim
/usr/share/cmake-3.13/editors/vim
/usr/share/lintian/overrides/vim
/usr/share/doc/vim
/usr/bin/vim

No directory such as /usr/share/vim seen in my friend's debian,that is to say ,install a broker vim and install ,reinstall can't fix my package magagement system.
There is a special directory /usr/share/lintian/overrides/vim.

ls  /usr/share/lintian/overrides  |grep  vim
vim
vim-common
vim-gtk3
vim-gui-common
vim-tiny

Show the content in these file.

debian@mydebian:/usr/share/lintian/overrides$ cat vim
# vim.xxx files are alternatives for (g)vim, which has a manpage in vim(-gui)-common
vim binary: binary-without-manpage usr/bin/vim.basic
debian@mydebian:/usr/share/lintian/overrides$ cat vim-common
# Provided by vim (virtual) packages
vim-common binary: desktop-command-not-in-package usr/share/applications/vim.desktop vim
debian@mydebian:/usr/share/lintian/overrides$ cat vim-gtk3
# vim.xxx files are alternatives for (g)vim, which has a manpage in vim(-gui)-common
vim-gtk3 binary: binary-without-manpage usr/bin/vim.gtk3
debian@mydebian:/usr/share/lintian/overrides$ cat vim-gui-common
# Provided by gvim (virtual) packages
vim-gui-common binary: desktop-command-not-in-package usr/share/applications/gvim.desktop gvim
debian@mydebian:/usr/share/lintian/overrides$ cat vim-tiny
# vim.xxx files are alternatives for (g)vim, which has a manpage in vim(-gui)-common
vim-tiny binary: binary-without-manpage usr/bin/vim.tiny
    

Remove all the file ls /usr/share/lintian/overrides |grep vim and install again?

showkey
  • 89
  • 4
  • 16
  • 40
  • This guide may help you: https://itsfoss.com/vim-8-release-install/ sudo apt install vim works but does not install the latest version. The above guide has a way to get to the new version. – John Feb 11 '21 at 00:36
  • 1
    Your locate's db seems to be outdated. "updatedb" should be run regularly. – Gerard H. Pille Feb 11 '21 at 03:54

2 Answers2

1

It seems that your directory /usr/share/vim was manually deleted (it is "not found" but still referenced by your original locate). You can reinstall it with:

apt install --reinstall vim-runtime

Explanations:

  • The /usr/share/vim is managed by the package vim-runtime, which is a dependency of the package vim.
    • You can check which package manages the directory with dpkg -S /usr/share/vim
    • Or you can list the directories managed by the package with dpkg -L vim-runtime
  • Reinstalling the vim package leaves vim-runtime untouched, so the /usr/share/vim is not reinstalled.
duthils
  • 301
  • 1
  • 1
0

If you run sudo apt install vim, you will have Vim installed and it will be functional. That package provides a reasonable set of Vim features without support for X11 or scripting languages. There are other packages, such as vim-nox and vim-gtk3, which provide more features.

You can configure which version of Vim you're using by default (if you have multiple installed) by running sudo update-alternatives --config vim. The default, if you have not specified one, is the most featureful version, but if you'd prefer a different one, you can change it. I don't recommend the tiny version unless you are specifically interested in a very minimal version with only basic vi features.

All of those packages except the tiny version depend on vim-runtime, which provides the normal runtime code. You can see where those files are located with dpkg -L vim-runtime. If you are using the tiny version, it does not depend on this functionality as that version contains only the most minimal scripting support and the runtime files can't usefully be used.

It looks like you may have the vim-tiny package as your Vim installed if you're not seeing the runtime files, so you could try installing vim-nox or vim-gtk3 and then configuring the proper version with update-alternatives.

In general, I recommend against using locate to determine what's actually on the disk since it is necessarily out of date, often inconveniently so. You are better off using find if you really want to know what's on disk.

bk2204
  • 2,451
  • 1
  • 5
  • 6