How To Fix Vi / Vim Editor Error — E319: Sorry, the command is not available in this version

by Ramesh Natarajan on September 4, 2009

Question: I’m getting the following error message in my Vim editor. How do I fix this issue?

E319: Sorry, the command is not available in this version: filetype plugin on

Answer: For the impatient, here is the quick answer. If you like to understand details on how to install this package, read further.

  • Problem: Vim Editor E319 Error Message.
  • Solution: Install vim-gui-common

1. Reproduce E319 Vim Editor Error

Add the following line to your ~/.vimrc file

# cat ~/.vimrc
filetype plugin on

Now, try to open any file in Vi editor, you should get the following error message.

# vim new-file.txt
Error detected while processing /home/ramesh/.vimrc:
line    1:
E319: Sorry, the command is not available in this version: filetype plugin on
Press ENTER or type command to continue

2. Check Your Vim Editor Version

Launch the Vim editor and give :version to see whether you are running Small version without GUI or full version of Vim editor with GUI.

When you do :version, if it shows “Small version without GUI“, this is your problem.

# vim
:version

Small version without GUI.

3. Check whether vim-gui-common is Installed

On Ubuntu and Debian, use dpkg command to see whether vim-gui-common is installed on your system. In this example, it is not installed.

# dpkg -l | grep -i vim
ii  vim-common
2:7.2.079-1ubuntu5  Vi IMproved - Common files ii  vim-tiny 2:7.2.079-1ubuntu5 Vi IMproved - enhanced vi editor - compact v

4. Search vim-gui-common and vim-runtime packages in Your OS Respository

Search your OS repository to make sure vim-gui-common package is available. Also, it is advisable to install vim-runtime package, which will help you to solve some other issues that you may encounter in the future. So, it is better to install both these packages.

In the following example, we can notice that these two packages are available in the OS repository.

# apt-cache search ^vim-gui-common
vim-gui-common - Vi IMproved - Common GUI files

# apt-cache search ^vim-runtime
vim-runtime - Vi IMproved - Runtime files

4. Install vim-gui-common and vim-runtime packages from the respository

Install both these packages using apt-get command as shown below.

# apt-get install vim-gui-common

# apt-get install vim-runtime

5. Verify that vim-gui-common and vim-runtime packages are installed

Execute the dpkg command to make sure these packages are installed.

# dpkg -l | grep -i vim
ii  vim-common                                 2:7.2.079-1ubuntu5                        Vi IMproved - Common files
ii  vim-gnome                                  2:7.2.079-1ubuntu5                        Vi IMproved - enhanced vi editor - with GNOM
ii  vim-gui-common                             2:7.2.079-1ubuntu5                        Vi IMproved - Common GUI files
ii  vim-runtime                                2:7.2.079-1ubuntu5                        Vi IMproved - Runtime files
ii  vim-tiny                                   2:7.2.079-1ubuntu5                        Vi IMproved - enhanced vi editor - compact v

6. Problem Solved !

Now, try to open any file in Vi editor, you will not get the E319 error message anymore.

# vi new-file.txt

Linux Sysadmin Course Linux provides several powerful administrative tools and utilities which will help you to manage your systems effectively. If you don’t know what these tools are and how to use them, you could be spending lot of time trying to perform even the basic administrative tasks. The focus of this course is to help you understand system administration tools, which will help you to become an effective Linux system administrator.
Get the Linux Sysadmin Course Now!

If you enjoyed this article, you might also like..

  1. 50 Linux Sysadmin Tutorials
  2. 50 Most Frequently Used Linux Commands (With Examples)
  3. Top 25 Best Linux Performance Monitoring and Debugging Tools
  4. Mommy, I found it! – 15 Practical Linux Find Command Examples
  5. Linux 101 Hacks 2nd Edition eBook Linux 101 Hacks Book

Bash 101 Hacks Book Sed and Awk 101 Hacks Book Nagios Core 3 Book Vim 101 Hacks Book

{ 3 comments… read them below or add one }

1 Priyanka Annam May 4, 2010 at 3:38 am

when I’m doing :syntax on or syntax off in vi editor .It is giving Can’t open file /home/pannam/VIM6/vim60/runtime/syntax/syntax.vim
and how the $VIMRUNTIME and $VIM varibles will set?
Can any one please help me on it?

2 deric January 19, 2011 at 9:51 am

my problem was that for some reason /usr/bin/vim pointed to -> /usr/bin/vim.gnome*

what I did was updating alternatives system:
this shows alternatives to vim
# update-alternatives –display vim

and here you can choose which version you prefere:
update-alternatives –config vim

3 Sindhu April 25, 2014 at 3:03 am

Thanks, worked well for me.

Leave a Comment

Previous post:

Next post: