This simple tutorial shows how to install 7-Zip file archive manager in Debian 12 Bookworm
7-Zip is a popular free open-source file archiver with a high compression ratio. It has its own archive type called 7z. And, if you just want to compress files to (or decompress) .7z file, then you need to do nothing since Debian has it support out-of-the-box.
7-Zip supports a number of other archive formats, including ZIP, gzip, bzip2, xz, tar, and WIM. It also supports unpacking ZIPX, APM, ar, ARJ, chm, cpio, deb, FLV, JAR, LHA/LZH, LZMA, MSLZ, Office Open XML, onepkg, RAR, RPM, smzip, SWF, XAR, and Z archives and cramfs, DMG, FAT, HFS, ISO, MBR, NTFS, SquashFS, UDF, and VHD disk images.
To install 7-Zip in Debian, you have 4 choices. They are:
- 7zip package (command line tool) from system repository.
- 7zip package (command line tool) from its website.
- p7zip-desktop – fork of p7zip with a graphical interface.
- p7zip – a command line port of 7-Zip for POSIX systems, including Linux, when 7-Zip was Windows-only. Discontinued since 2016, but still popular and working good.
Choose one of them that you prefer.
Option 1: 7zip .deb package (command line) from system repository
7-Zip adds native Linux support since version 21.0, which however is command line only!
Debian includes the 7zip package in system repository. To install it, simply launch a terminal window and run command:
sudo apt install 7zip
After installed the package, run 7zz
command to tell the version and help info. It’s a standalone console version of 7-Zip, compiled for dynamic system library linking.
For how to use 7zz command, here are the basic command examples:
- Add file or directory to archive (or create a new one):
7zz a archive_name.7z file_name
- Add file or directory to archive, and set password with flag
-p
and hide structure of the archive with flag-mhe=on
:7zz a archive_name.7z file_name -p -mhe=on
- Print (list) the content of an archive:
7zz l archive_name.7z
- Extract all files from an archive to the current directory without using directory names:
7zz e archive_name.7z
Option 2: 7zip official Linux package (command line)
As you see in the screenshot above, 7zip package in system repository is old!
For the latest version, 7zip website provides the official Linux tarball via the link below:
For each version, it provides packages for x86_64 (modern Intel/AMD), x86, 32-bit/64-bit arm devices support. If you don’t know your system type, run uname -m
command in terminal to tell.
After downloaded the package, open Downloads folder, extract the tarball, then right-click on extracted folder and click “Open in Terminal“. If you DE does NOT has the context menu option, then just launch terminal and use ‘cd’ command to navigate to that folder.
In the pop-up terminal window, run ls
command will list file content in current directory. To install the 7zz console version, just run commands:
sudo install 7zz /usr/local/bin
sudo install 7zzs /usr/local/bin
Different to 7zz
, 7zzs
is the standalone console version of 7-Zip compiled with static system library linking.
When done, run either 7zz
or 7zzs
command to verify 7-Zip version and command options.
Option 3: p7zip-desktop (GUI)
For users who prefer a graphical user interface, p7zip-desktop
is the only choice as far as I know.
It’s a fork of p7zip based on 7-Zip 16.02. It’s old, discontinued, and available as Snap (runs in sandbox) but still working good.
To install p7zip-desktop, first launch a terminal window, then run command to enable snap support:
sudo apt install snapd
Then run command to install the package:
snap install p7zip-desktop
After installed the package, run snap run p7zip-desktop
to launch the graphical tool.
Option 4: p7zip
p7zip is a fork of 7-Zip when it was Windows only. It’s discontinued since 2016, but still available in system repository just for choice!
To install p7zip, open terminal and run command:
sudo apt install p7zip-full --install-suggests
NOTE: for the rar module, you need to first enable ‘non-free’ and ‘contrib’ repositories using Software & Updates tool
After installed the package, you have 3 command line tools. Run any one to tell version and command options.
- 7z uses plugins to handle archives.
- 7za is a stand-alone executable that handles fewer archive formats than
7z
. - 7zr light-version of
7za
that only handles 7z archives.
Uninstall 7-Zip
Depends on which package you installed, uninstall the graphical tool p7zip-desktop
by running command
snap remove p7zip-deesktop
To remove p7zip and 7zip package installed from system repository, use command:
sudo apt remove --autoremove p7zip-full 7zip
And, to uninstall the package downloaded from 7zip website, use command:
sudo rm /usr/local/bin/7zz /usr/local/bin/7zzs
Leave a Reply