10

I am using opensuse for my production environment. I am login as "test" user and trying to edit a file using "vi" but when i am going to save that file it shows the following error

**

E138: Can't write viminfo file /home/test/.viminfo

**

Under the "test" user all the files and folder autometically become read-only. I am trying to change the permission using "root" user but unable to change it. also I look for temp file like "~/.viminf*" but there nothing like this.

Don't know what to do plaese help.... anyone aware about this problem

Biswajit
  • 157
  • 1
  • 3
  • 12

1 Answers1

19

Fix your home directory owner and permissions.

sudo chown -R test /home/test

sudo chmod u+rw -R /home/test

And finally check that no old temp files were left behind (e.g. ~/.viminf*) and that you can write in the directory of the .viminfo file.

Mohammed Habib
  • 606
  • 5
  • 10
  • its not wroking, it shows pstscos341:/home/sibuild # sudo chown sibuild /home/sibuild/jira_certificate. sath.com chown: changing ownership of `/home/sibuild/jira_certificate.sath.com': Read-only file system – Biswajit Feb 18 '13 at 07:39
  • pstscos341:/home/sibuild # sudo chmod +urw /home/sibuild/jira_certificate.sath.com chmod: invalid mode: `+urw' Try `chmod --help' for more information. – Biswajit Feb 18 '13 at 07:40
  • Just edited the answer. Don't use sudo if you are trying this in root shell '#' – Mohammed Habib Feb 18 '13 at 07:45
  • still not working...same error – Biswajit Feb 18 '13 at 08:13
  • It looks that the file /home/sibuild/jira_certificate.sath.com is currently in-use and you cannot change its permission. What is this file used for? – Mohammed Habib Feb 18 '13 at 08:23
  • it used for nothing....I just keep this file here – Biswajit Feb 18 '13 at 08:32
  • Simply issue the following on Ubuntu or Debian >> sudo chown user:group /home/user/.viminfo changes the file permission to be owned by the current users using vim as @MohammedHabib said – David Okwii Aug 26 '15 at 09:51
  • 1
    `rm ~/.viminf?.tmp` worked for me - I had one for each letter of the alphabet – Gedge Feb 09 '18 at 09:19