4

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.

7

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
  • 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/disable-file-locking.xcd. – DKroot Apr 26 '17 at 19:57
1

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">

  • Make the change while all LO documents are closed. LO will rewrite its settings when we close a document. – Stephen Boston Oct 4 '19 at 12:11
0

You can now change settings (even in Windows) from UI. Source

Since version 4.2, we have Expert Configuration feature allowing one to set different power-user settings from [...]
Options->LibreOffice->Advanced->Open Expert Configuration. [...]
org.openoffice.Office.Common/Misc/UseLocking setting
(controlling creation of lockfiles and using locking in general), and org.openoffice.Office.Common/Misc/UseDocumentOOoLockFile setting
(controlling whether the present lockfile will be considered when deciding if the file is locked by someone else).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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