What is the command in the terminal to update Vim on Ubuntu?

vim
95,982

Solution 1

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

Solution 2

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).

Solution 3

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.

Solution 4

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.

Solution 5

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.

Share:
95,982

Related videos on Youtube

Patoshi パトシ
Author by

Patoshi パトシ

Updated on September 18, 2022

Comments

  • Patoshi パトシ
    Patoshi パトシ over 1 year

    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?

  • d4nyll
    d4nyll about 6 years
    To get the latest version available, check my answer
  • MikaelF
    MikaelF about 4 years
    I needed to run ./configure before make. Also, using checkinstall instead of make install might be a good idea, if you ever plan on updating Vim.
  • CKM
    CKM almost 4 years
    vim git repo is so huge man.
  • Asocia
    Asocia over 3 years
    "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.
  • Admin
    Admin almost 2 years
    This no longer works: Err:13 ppa.launchpadcontent.net/jonathonf/vim/ubuntu jammy Release 404 Not Found [IP: 185.125.190.52 443]