title_body: How to repack an epub file from command line I unzipped an epub file to make some minor modifications. How can I repack it properly to be a valid epub file from command line on Linux?
upvoted_answer: zip -rX ../my.epub mimetype META-INF/ OEBPS/
  
  
  
  
  Without -X you could get the following when validating it with EpubCheck:
  
  ERROR: my.epub: Mimetype entry must not have an extra field in its ZIP header
  
  
  If mimetype is not the first in the epub file EpubCheck prints the following:
  
  ERROR: my.epub: Mimetype entry missing or not the first in archive