I want to disable file locking in LibreOffice, i.e., the creation of a hidden lock file in the directory of an opened document. The advice of the official documentation to comment out the second of the lines

SAL_ENABLE_FILE_LOCKING=1
export SAL_ENABLE_FILE_LOCKING

in /usr/bin/soffice (which is really a symbolic link targeting /usr/lib/libreoffice/program/soffice) does not help. The lock files are still created.

I use Ubuntu 12.04 which has LibreOffice 3.5.7.2.

share|improve this question
up vote 5 down vote accepted

To disable locking open Terminal application, then copy, paste and execute following command.

Notice: it's one long command, 12 lines, starts with "echo" and ends with "disable-file-locking.xcd".

echo '<?xml version="1.0" encoding="UTF-8"?>
<oor:data xmlns:oor="http://openoffice.org/2001/registry">
  <dependency file="main"/>
  <oor:component-data oor:package="org.openoffice.Office" oor:name="Common">
    <node oor:name="Misc">
      <prop oor:name="UseLocking">
        <value>false</value>
      </prop>
    </node>
  </oor:component-data>
</oor:data>' |
sudo tee /usr/lib/libreoffice/share/registry/disable-file-locking.xcd

To undo changes:

sudo rm /usr/lib/libreoffice/share/registry/disable-file-locking.xcd
share|improve this answer
    
I know this is Ask Ubunutu, biut for googlers wondering about the same problem on macOS: the same recipe works using /Applications/LibreOffice.app/Contents/Resources/registry/di‌​sable-file-locking.x‌​cd. – DKroot Apr 26 '17 at 19:57

Modify ~/.config/libreoffice/4/user/registrymodifications.xcu.

Add

<item oor:path="/org.openoffice.Office.Common/Misc"><prop oor:name="UseLocking" oor:op="fuse"><value>false</value></prop></item>

after the other <item oor:path="/org.openoffice.Office.Common/Misc">

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.