"declare copy-namespaces no-preserve, inherit;" must come first:
$ cat e
declare option output:omit-xml-declaration "no";
declare copy-namespaces no-preserve, inherit;
<z/>
$ basex e
Stopped at line 2, column 8 in /tmp/e:
[XPST0003] Unexpected end of query: 'copy-namespaces...'.
$ cat f
declare copy-namespaces no-preserve, inherit;
declare option output:omit-xml-declaration "no";
<z/>
$ basex f
<?xml version="1.0" encoding="UTF-8"?>
<z/>
$ apt-cache policy basex
basex:
Installed: 7.0.2-1