To install Vim in Ubuntu, execute the code, sudo apt install vim
on your Ubuntu terminal.
Vim is a text-processing editor used in Unix-like operating systems like Linux. Go through this article to learn 5 ways to install Vim in Ubuntu. Moreover, you will also get to learn how to install different versions of Vim and how to uninstall it.
5 Methods to Install Vim in Ubuntu
Vim is readily available on all Linux platforms, therefore installing it doesn’t involve many complicated processes. Since Ubuntu is a Debian-based Linux distro, you can install it using apt, apt-get, and snap package managers. This task can also be accomplished using the graphical user interface (GUI). I will go into great depth about each method in this section.
1. Using “apt”
To install Vim in Ubuntu using the apt package manager, follow the steps below:
- Open a terminal window by Pressing CTRL+ALT+T.
- Update the repository list before installing Vim using the following command:
sudo apt update
- After updating the packages, install Vim with this command:
sudo apt install vim
- To check whether the Vim is installed or not, copy the following code:
vim --version
You can also execute this command to check the installed Vim text editor:
dpkg -l | grep vim
You can see that all the packages of Vim are installed on your system.
Note: You can install Vim in Ret-hat-based Linux distributions like CentOS and Fedora by using this command:
sudo yum install vim
2. Using “apt-get”
Apt-get is another package manager that you can use to install the Vim editor on your Ubuntu. First, follow step 2 method 1 to update the repo list. Then execute the following command:
sudo apt-get install vim
Now, you can verify the installed Vim using the same way as was mentioned in Step 4 method 1.
3. Using PPA-Repository
PPA stands for personal package archive which is a subset of apt repositories, offering the latest version updates of software packages. So, to install the latest version of the Vim text editor, follow this method:
- Run this add-repository command to add the PPA jonathonf/vim on your system:
sudo add-apt-repository ppa:jonathonf/vim
- Once you have added the PPA-repository, update the package list using sudo apt update and copy the code below to install the latest version of Vim:
sudo apt install vim
- Check the version using
vim --version
command:As you can see the latest version of vim text editor has been installed on your Ubuntu.
4. Using “snap”
You can install Vim from the snap store in Ubuntu with the snap command. For that, execute the below command:
snap install --beta vim-editor
After running this command, an authentication window will arrive, asking for your Ubuntu password:
Now, you can create any file using the vim-editor command followed by the filename.
5. Using GUI
The most convenient way to install vim is to GUI. This technique is for people who find difficulty in using commands. There are two ways to achieve this task, one is using Ubuntu software and the other one is using a synaptic package manager. Follow the detailed steps below:
5.1 Ubuntu Software
Ubuntu software serves as a centralized location for installing, removing, and managing available software packages. It provides all the basic information that you need to install software. Here are the steps to install Vim with Ubuntu Software:
- First, go to “Ubuntu software” by clicking the “Show Applications” button:
- After going to the “Ubuntu Software”, write “vim” in the search bar to find the vim packages:
- Click the “install” button to install the Vim:
- An authentication window will appear then: The vim installation process will be done after providing the Ubuntu password.
5.2 Synaptic Package Manager
Installing Vim with Synaptic package manager offers more control over packages. To learn how to accomplish this, follow the steps below:
- Find the synaptic package manager by clicking the “Show Applications” button:
- Search for the Vim package in the synaptic package manager and click “Mark for Installation”:
- Finally, click “Apply” to install the vim text editor on your Ubuntu:
How to Install a Specific Version of Vim in Ubuntu?
To install a specific version of Vim in Ubuntu, use apt or apt-get package manager followed by the exact Vim version number. For instance, to install Vim version 2:8.2 using apt, copy the following code:
sudo apt install vim=2:8.2.*
Check the vim version by following step 4 method 1 to verify if the specified version is installed.
How to Uninstall Vim in Ubuntu?
To uninstall Vim in Ubuntu, consider using the apt or apt-get package manager. Here, I will show you the whole process for removing Vim from your Linux system using the apt package manager:
- Open the terminal using CTRL+ALT+T.
- Now, execute the following code to uninstall Vim in Ubuntu:
sudo apt remove vim
As you can see the vim has been removed from Ubuntu.
- To remove further dependencies, run this command:
sudo apt autoremove
Now, the vim with all dependencies is completely removed from your Linux system. To uninstall Vim with all of its configuration files, you can run
sudo apt remove --purge vim
.
Note: If you use Red-hat-based Linux distros, then run this command to remove vim:
sudo yum remove vim
Conclusion
To conclude, I have demonstrated 5 methods of installing the Vim text-processing tool in Ubuntu. You will also get to know how to install a specific version of a Vim package. Additionally, I have added how to uninstall it in Ubuntu. Choose any method that best suits your needs and interact through the comment section if you face any issues while installing!
People Also Ask
How to install Vim in command line?
To install Vim in command line, write sudo apt install vim in the command. Don’t forget to provide your password if prompted.
Should I use vi or Vim?
Vim is the improved version of vi. It has some extra features like syntax highlighting, multiple buffers, plugins, and more. So if you need these features, you should use vim otherwise stick with the vi tool.
Which editor is best Vim or nano?
Vim is a highly customizable and versatile text editor popular among developers and system administrators. But you should have a good command over vim to unleash its potential. On the other hand, nano is a simple text editor that requires minimal expertise, suitable for beginners.
Is vi on every Linux system?
Yes, vi is available on all Unix-like operating systems like Linux, macOS, etc. If you don’t have vi installed on your machine, you can install it with the package managers of your operating system.
Related Articles
- How to Edit With Vim in Linux? [Explained]
- How to Install and Use Vim-Plug in Linux [Explained]
- How to Set Vim Color Scheme in Linux? [4 Steps]
<< Go Back to Vim in Linux | Linux Text Editors | Learn Linux Basics
FUNDAMENTALS A Complete Guide for Beginners