Score:4

Difference between several command-line tools provided for 7-Zip compression (like `7z`, `7zz`...)

cn flag

When I search for 7zip in Ubuntu 23.04 packages, I find several results.

For example, package p7zip-full contains the /usr/bin/7z executable, while package 7zip contains the /usr/bin/7zz executable.

  • Version of 7z (in p7zip-full) is:

7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21

  • Version of 7zz (in 7zip) is:

7-Zip (z) 22.01 (x64) : Copyright (c) 1999-2022 Igor Pavlov : 2022-07-15

And they seem to provide similar functionality.

What is the difference between these two commands and why Ubuntu 23.04 provides several packages with different versions?

What is the recommended package to provide "7-Zip command-line" functionality (with the ability to save and restore UN*X permissions and other meta-file data)?

muru avatar
us flag
P7zip is an unmaintained fork of 7z which added POSIX support back when 7z was Windows only. But now 7z works on Linux, so you have the 7zip package providing the upstream version. Your second question should be a separate post.
FedKad avatar
cn flag
I am _in search for the right tool to create and restore 7-Zip archives_ (both command line for batch processing and GUI for normal usage). I tried to reword my question.
muru avatar
us flag
Neither P7zip or 7-zip have GUIs on Linux, so I repeat: your GUI [tag:software-recommendation] question has nothing to do with either of them and should be a separate post
FedKad avatar
cn flag
@muru I removed the last sentence... Regarding your first comment: Do you recommend using the `7zz` command in place of `7z` (especially regarding the Posix support on handling meta-file info.)?
Score:4
us flag

The p7zip package on Ubuntu and Debian is from a fork of 7zip that added POSIX compatibility (for execution) back when 7zip was Windows-only. It is unmaintained, not having seen a release since 2016 (though maybe some would argue that makes it extraordinarily stable). (Arch Linux apparently packages a fork of p7zip.) Its manpage has this warning:

DO NOT USE the 7-zip format for backup purpose on Linux/Unix because :

  • 7-zip does not store the owner/group of the file.

It seems it does support permissions, but those are often not sufficient for a proper backup without the user/group information to go with them.

From the Debian ITP (intent to package) for 7zip:

note: "p7zip-full" package provides full-featured, but older 7-Zip archiver. This "7zip" package provides stand-alone style archiver only, but newer 7-Zip archiver.

"7zip" package is in "non-free" section because "unRAR" code is not compatible with DFSG.

The ITP further clarifies that RAR support was then disabled to comply with the Debian Free Software Guidelines (DFSG).

Nothing I have seen so far seems to indicate that the format has been changed to add support for ownership information on Linux. If you absolutely must use it for backups on Linux, either be prepared to miss out on ownership information or create tar archives compressed with 7z.

Neither package offers a GUI.

FedKad avatar
cn flag
It seems that both `7z` and `7zz` store file permission, but not ownership as you mentioned. I am using `7z` for personal backups (not system backups), so it is OK. I am still confused about the command name of `7zz` and the reason of keeping both packages in Ubuntu (universe) repositories.
muru avatar
us flag
There's no particular reason to stop packaging p7zip since it's not broken in anyway, and since it provides the 7z command, 7zip would have to either conflict with it to use the same command name, or the respective maintainers would have to work together to set up the Debian alternatives system for it. I'm guessing the packager for 7zip just went for the easiest way out, which is to use a different name, allowing it to be coinstallable with pz7ip.
FedKad avatar
cn flag
OK. Thanks for the answer.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.