Dove si trova Vim su Ubuntu Linux e come si installa?
“which vim” tells you where it is.
- matthew@bigfoot:~$ which vim
- /usr/bin/vim
On my system it’s /usr/bin/vim.
If you didn’t install it from source, it’s most certainly installed using a dpkg package and most probably from APT.
Per la maggior parte dei pacchetti puoi usare "dpkg -S name" per dirti quale pacchetto ha installato il file.
Ma VIM è un po' speciale, perché usa il sistema Debian alternatives (DebianAlternatives - Debian Wiki) dato che più pacchetti possono fornirlo. Perché lo so? Perché se fai "ls -l /usr/bin/vim", ti dice che il file è un link simbolico a /etc/alternatives/vim.
- matthew@bigfoot:~$ ls -l /usr/bin/vim
- lrwxrwxrwx 1 root root 21 Sep 15 22:24 /usr/bin/vim -> /etc/alternatives/vim
As it turned out, /etc/alternatives/vim is itself another symbolic link, that, on my system, points to /usr/bin/vim.basic
- matthew@bigfoot:~$ ls -l /etc/alternatives/vim
- lrwxrwxrwx 1 root root 18 Sep 15 22:24 /etc/alternatives/vim -> /usr/bin/vim.basic
Finally, we can figure out which package is responsible for it.
- matthew@bigfoot:~$ dpkg -S /usr/bin/vim.basic
- vim: /usr/bin/vim.basic
It’s the vim package! As you might have guessed.