Linux Administrator

Vim Error E138: Can’t write viminfo file $HOME/.viminfo!

If you are getting below error, most likely this is happens because the home directory has run out of disk space and no free inode is left on the server that’s why any new vim operation is unable to write in the .viminfo file.

Error :

Vim Error E138: Can’t write viminfo file $HOME/.viminfo!

In this article I will show how you can fix this error.

Check Disk Space

First of all check disk space on the server using below command.

# df -h

If everything is looks fine then check inode usage using below command.

# df -i

If found this issue on my vps server because there was no free inode was left. I fixed this issue increasing inode on the server.

If above situation is fine than there could be lots of reason, may be viminfo file in $/HOME/.viminfo! is corrupted. You should fix this removing this file as shown below.

# rm /HOME/.viminfo*

You can also check the permission and ownership of /HOME/.viminfo* For some reason, this resulted in the owner of the directory to be “nobody“. Adding write permissions for “other” solved the problem.

# chmod o+w ~/.viminfo

Hope this helps you!

Thank you! for visiting LookLinux.

If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website To become an author at Look Linux Submit Article. Stay connected to Facebook.

About the author


Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

Leave a Comment