I'm on Ubuntu 12.04 and want to know how to update Vim via the command line. What is the command to update this?
5 Answers
To get the latest stable version, it is recommended by the official instructions to directly install it from the source GitHub repository.
$ git clone https://github.com/vim/vim.git
$ cd vim/src
$ make
$ sudo make install
You can also use apt-get update && apt-get install vim
to update Vim to the latest version available in your distribution's packages registry. To update all available packages, you can run apt-get update && apt-get upgrade
However, you may not get the latest version of Vim with APT (you'll moszt likely the latest major version, but not the minor / patch versions).

- 2,664
Run these commands in a terminal:
sudo apt-get update
sudo apt-get install vim
Note that Ubuntu may not always have the latest packages due to the [official] repositories being frozen.

- 28,246
- 16
- 81
- 118
the best answer to this question is https://vi.stackexchange.com/a/10827/32151
and according to the linked answer, another way to doing this is using Personal Packet Archive (PPA)
add this PPA
sudo add-apt-repository ppa:jonathonf/vim
Update the package lists:
sudo apt update
install vim:
sudo apt install vim

- 386
-
1This no longer works: Err:13 https://ppa.launchpadcontent.net/jonathonf/vim/ubuntu jammy Release 404 Not Found [IP: 185.125.190.52 443] – user2121 Jul 07 '22 at 10:30
If you are working on Ubuntu16/CentOS7, you can use below commands to install latest vim.
Ubuntu16
sudo apt-get install gcc git ncurses-dev
git clone --depth=1 https://github.com/vim/vim.git
cd vim/src
sudo make
sudo make install
Centos7
change first command to:
sudo yum install gcc git ncurses-devel
Logout and login if you are still seeing older version.

- 19,615
- 55
- 79
- 83

- 191
-
1"Logout and login if you are still seeing older version." yep, this was the solution for me. I don't know how this could even be a problem. – sahinakkaya Oct 21 '20 at 12:37
I would generally recommend using sudo apt-get update ; sudo apt-get dist-upgrade
, as this will update everything that apt-get can update on your system. If you don't already have VIM installed, you can get it using sudo apt-get install vim
.

- 1,444
- 2
- 15
- 19
./configure
beforemake
. Also, usingcheckinstall
instead ofmake install
might be a good idea, if you ever plan on updating Vim. – MikaelF Jan 30 '20 at 06:07