Ask Your Question

LibreOffice 6.0 unzip - zip open document file?

asked 2019-03-06 23:51:12 +0200

xenon1 gravatar image

updated 2019-03-06 23:52:16 +0200

In LibreOffice 5.0 I used to be able to open an Open Document file (e.g. *.ods or *.odb) on a low level by unzipping it. Then I could change something there on the "low level", zip it again and use it. I used the Ubuntu archive manager to do that.

Since Ubuntu 18.4 and LibreOffice 6.0 this does not work any more. The archive manager does not open it ("archive type is not supported"). However, if I open it with the utility "unzip" into a folder (that still works!) and, without changing anything, zip it again (put it into a zip-archive "" and change the extension from ".zip" to e.g., ".odb"), then LibreOffice cannot open it; it considers the file corrupt.

a) Did the file format change?

b) What can I do if I need to make low level changes to an Open Document file?

Thanks for an answer!


edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2019-03-07 00:46:07 +0200

erAck gravatar image

updated 2019-03-08 12:40:13 +0200

Likely that version of archive manager has some broken means what could be a zip file.. the file format did not change, it still is a zip container, otherwise the unzip utility would refuse to run on it.

When (re)zipping an ODF document you must ensure that the mimetype file is the very first file in the archive and not compressed, it must be plain text. If that is not the case (compressed file or different position in the zip directory) then it is not a valid ODF file.

To achieve that, easiest is to freshen the existing zip with the modified file(s) instead of creating a new zip, i.e. use the -f option, for example zip -f /path/to/filename.ods content.xml

When creating a new zip, add and store only the mimetype file first using the -0 (numeric zero, not letter O) option. Then add other files using the -u option.

edit flag offensive delete link more


Fwiw, I just tried with file-roller 3.22.3 (which is Archive Manager) and indeed already that doesn't accept for example an .ods document, and also not one that is 10 years old.

erAck gravatar imageerAck ( 2019-03-07 00:54:56 +0200 )edit

"When (re)zipping an ODF document you must ensure that the mimetype file is the very first file in the archive and not compressed, it must be plain text." How do I do that? - And thank you for your fast answer, erAck!

xenon1 gravatar imagexenon1 ( 2019-03-07 09:12:48 +0200 )edit

Maybe saving those, with the flat format can make easy edit the files (only fodt, fods, fodp).

m.a.riosv gravatar imagem.a.riosv ( 2019-03-08 04:16:38 +0200 )edit

I updated my answer with "how to do that".

erAck gravatar imageerAck ( 2019-03-08 12:40:49 +0200 )edit

answered 2019-07-09 15:02:35 +0200

xenon1 gravatar image

Just found the solution: Rename file: a) replace *.ods with *.zip. Or, even easier: b) add .zip to file name.

Now the archive program opens it easily! It seems that the Linux-program archive does not want to open files with the "wrong" file extension.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-03-06 23:51:12 +0200

Seen: 245 times

Last updated: Jul 09