If you are getting this error “Can’t write viminfo file” it means there is no space left on the system.
It happens due to out of disk space or may be no free inode is left on the server/system.
This could be the main reason that vim operation is unable to write in the .viminfo file. First you should check your server disk space.
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 Filesystem Size Used Avail Use% Mounted on devtmpfs 7.8G 64K 7.8G 1% /dev tmpfs 7.8G 0 7.8G 0% /dev/shm /dev/nvme0n1p1 148G 98G 50G 67% /
If everything is looks fine. In my example my disk / partition disk space is 67% used it means all looks good no need to increase disk. Now let’s check inode usage using below command:
Follow my this tutorial to find : Top 10 Space Consuming Directories & Files On Linux & UNIX System
# df -i Filesystem Inodes IUsed IFree IUse% Mounted on devtmpfs 2028382 473 2027909 1% /dev tmpfs 2030623 1 2030622 1% /dev/shm /dev/nvme0n1p1 9830400 199034 9631366 3% /
Check this line:
/dev/nvme0n1p1 9830400 199034 9631366 3% /
If it is showing 100% Isue means you have to make some space on your server. In my case it is using only 3%.
I found this issue on my vps server 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 will help you!
If want to learn basic vi command follow my this tutorial : Understanding Basic Vi Editor
If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website www.looklinux.com. To become an author at LookLinux Submit Article. Stay connected to Facebook.
I’m excited to find this great site. I need to to thank you for ones time for this wonderful read!!
I definitely savored every part of it and I have you saved as a favorite
to see new stuff on your blog.
Excellent post however , I was wondering if you could write a litte more on this subject?
I’d be very thankful if you could elaborate a little bit more.
Bless you!
Hi there would you mind letting me know which webhost you’re using?
I’ve loaded your blog in 3 completely different internet browsers and I must say this
blog loads a lot quicker then most. Can you suggest a good web hosting provider at a
reasonable price? Thanks a lot, I appreciate it!
Hi to all, it’s in fact a good for me to go to see this web site, it includes priceless
Information.
In fact when someone doesn’t understand then its up to other users that they will assist, so here it takes place.
This site was… how do I say it? Relevant!! Finally I have
found something which helped me. Kudos!
I’ve learn a few excellent stuff here. Definitely price bookmarking for revisiting.
I surprise how so much attempt you place to create this kind of great
informative site.
Thanks.
Hurrah! Finally I got a website from where I be capable of truly take helpful data concerning my
study and knowledge.