How to install vi (not vim)?
Solution 1:
There's no such thing as "original" vi on Linux.
If one wants to try the original flavor of vi, there's several versions he can try.
vim.tiny as the other answer suggested.
run
busybox vi
, busybox-static is default installed on 18.04/18.10. This version is a very small clone of vi.The traditional vi project, run by Gunnar Ritter, the first one who ported vi to Linux. You need to compile from source for this one.
Solution 2:
To install vi in all currently supported versions of Ubuntu open the terminal and type:
sudo apt install vim-tiny
This package contains a minimal version of Vim compiled with no GUI and a small subset of features which runs with 'compatible' set, no language bindings, no X/GUI support. This package's sole purpose is to provide the vi binary for base installations.
If a vim binary is wanted, try one of the following more full-featured packages: vim, vim-nox, vim-athena, vim-gtk, or vim-gtk3.
To edit a file named FILE in vi type:
vi /path/to/FILE
Results of which vi
:
/usr/bin/vi
Results of update-alternatives
:
$ update-alternatives --list vim /usr/bin/vim.gtk3 $ update-alternatives --list vi /usr/bin/vim.gtk3 /usr/bin/vim.tiny $ update-alternatives --config vi There are 2 choices for the alternative vi (providing /usr/bin/vi). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/bin/vim.gtk3 50 auto mode 1 /usr/bin/vim.gtk3 50 manual mode 2 /usr/bin/vim.tiny 15 manual mode Press <enter> to keep the current choice[*], or type selection number: