Ask Your Question

How to unlock file [closed]

asked 2013-06-19 13:05:59 +0200

Seddy gravatar image

updated 2013-06-19 13:07:22 +0200

My computer crashed while I had a file open in calc: "x.ods". I'm now unable to open the file in write mode again, because calc says the file is already opened by an unknown user. What I tried:

  • delete the lock file ".~lock.x.ods#"

  • delete "~/.config/libreoffice"

Is there yet another lock file which I have to delete? By the way, x.ods is not corrupted. If I change it's name it opens fine.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-02-19 10:29:17.253548


Verify if the file x.ods file have read/write permissions.

m.a.riosv gravatar imagem.a.riosv ( 2013-06-19 14:06:10 +0200 )edit

I had read and write permissions.

Seddy gravatar imageSeddy ( 2013-06-19 14:19:17 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2013-06-19 14:14:11 +0200

oweng gravatar image

updated 2013-06-20 05:14:03 +0200

Where was/is the file stored? Was it on a network location? Try moving it to another location and opening it without renaming it. The lock file and user profile (as you indicate) are the usual methods to solve a basic file lock type of issue. If your computer crashed though you may be experiencing a network file permission issue or a lock by another process (such as the NFS lock daemon).

This is what it says in the readmes/README_en-US file of the GNU/Linux download:

File Locking

File locking is enabled by default in LibreOffice. On a network that uses the Network File System protocol (NFS), the locking daemon for NFS clients must be active. To disable file locking, edit the soffice script and change the line "export SAL_ENABLE_FILE_LOCKING" to "# export SAL_ENABLE_FILE_LOCKING". If you disable file locking, the write access of a document is not restricted to the user who first opens the document.

Warning: The activated file locking feature can cause problems with Solaris 2.5.1 and 2.7 used in conjunction with Linux NFS 2.0. If your system environment has these parameters, we strongly recommend that you avoid using the file locking feature. Otherwise, LibreOffice will hang when you try to open a file from a NFS mounted directory from a Linux computer.

edit flag offensive delete link more


Ok, this could be the solution. The file is indeed stored on a NFS. I copied it to my desktop without renaming it and it opened fine. Then I deleted the original file and copied the file from the desktop back. Now everything works fine again.

Seddy gravatar imageSeddy ( 2013-06-19 14:22:53 +0200 )edit

Thanks for confirming, I will update my answer with a little more detail.

oweng gravatar imageoweng ( 2013-06-20 05:01:21 +0200 )edit

Could someone describe the typical location of "the soffice script" as described above on a Windows 7 installation?

CSmith gravatar imageCSmith ( 2014-12-07 20:05:42 +0200 )edit

@CSmith, it should be located under C:\Program files (x86)\LibreOffice 4.x\program\.

oweng gravatar imageoweng ( 2014-12-28 03:54:24 +0200 )edit

Worked! Except that instead of copying I moved the file from the folder to the desktop (right click, select "move here"), then just moved it back to the original folder. Opened and edited it with no problem after that. (So no renaming or deleting copies necessary) Thanks!

chilicon gravatar imagechilicon ( 2017-09-22 01:44:44 +0200 )edit

Question Tools


Asked: 2013-06-19 13:05:59 +0200

Seen: 35,218 times

Last updated: Feb 15 '14