How To Install 7-Zip on Debian 13

File compression is a daily reality in Linux system administration, development, and general desktop use. Whether you are archiving project directories, sending large files over the network, or protecting sensitive data with encryption, you need a tool that is fast, reliable, and format-flexible. 7-Zip checks every box. It is free, open-source, and widely regarded as one of the best file archivers available on any platform.
Debian 13 (codenamed Trixie) makes it easier than ever to get 7-Zip running. The official 7zip package is now available directly from the default system repository — no third-party sources required. You can also install the latest official upstream binary from GitHub if you need cutting-edge features or broader format support.
This guide walks you through both installation methods, covers essential and advanced usage commands, addresses the most common troubleshooting scenarios, and explains how to cleanly remove 7-Zip when needed. By the end, you will have a fully operational 7-Zip setup and the practical knowledge to use it confidently from the terminal.
What Is 7-Zip and Why Use It on Debian 13?
7-Zip is a free, open-source file archiver released under the GNU LGPL license. It was originally developed for Windows by Igor Pavlov, but since version 21.0, it ships with native Linux support. The tool is known for its LZMA and LZMA2 compression algorithms, which consistently deliver a higher compression ratio than traditional ZIP utilities.
Supported Archive Formats
The 7zip package on Debian 13 handles the following formats for both compression and extraction:
- 7z, ZIP, GZIP, BZIP2, XZ, TAR, WIM — Full read/write support
- RAR, RAR5, ISO, DMG, NTFS, FAT, MBR — Extraction only
- APM, ARJ, CHM, CPIO, DEB, LZH/LHA, RPM, SquashFS, XAR, Z — Extraction only
Why 7-Zip Stands Out
There are several reasons Linux users consistently reach for 7-Zip over alternatives like zip, gzip, or bzip2:
- Superior compression ratio — LZMA compression typically beats ZIP by 30–70% on comparable data
- AES-256 encryption — Protect archive contents and even file names with strong password encryption
- Multi-threading by default — 7-Zip automatically utilizes all available CPU cores during compression
- Wide format support — Open, extract, and create archives across dozens of formats in one unified tool
- Debian 13 advantage — The
7zippackage on Trixie ships version 25.x with RAR/RAR5 extraction, a notable improvement over Debian 12’s 22.x build
On Debian 13, the APT package installs the 7z command — the same binary name familiar to long-time Debian and Ubuntu users.
Prerequisites
Before starting, confirm the following are in place:
- A running Debian 13 (Trixie) system — physical machine, virtual machine, or VPS
- Terminal access — local desktop terminal or remote SSH session
- Sudo privileges — required for APT installation and system-wide binary placement
- Active internet connection — to download packages or binaries from official sources
Verify your Debian release with:
lsb_release -a
Expected output:
Distributor ID: Debian
Description: Debian GNU/Linux 13 (trixie)
Release: 13
Codename: trixie
If the output confirms Debian 13, you are ready to proceed.
Understanding 7-Zip Package Differences Across Debian Releases
Debian packages 7-Zip under different names across releases. Knowing this distinction prevents confusion, especially when following tutorials written for other versions.
| Debian Version | Package | Command | APT Version | RAR Support |
|---|---|---|---|---|
| Debian 13 (Trixie) | 7zip |
7z |
25.x | Yes |
| Debian 12 (Bookworm) | 7zip |
7zz |
22.x | No |
| Debian 11 (Bullseye) | p7zip-full |
7z |
16.x | Yes |
Debian 13’s 7zip package is a meaningful upgrade. It brings the 7z command back (Debian 12 used 7zz), includes RAR/RAR5 decoding, and ships a far more recent compression engine.
Method 1: Install 7-Zip via APT (Recommended)
The APT package manager is the recommended installation path for most Debian 13 users. It handles dependency resolution automatically, integrates with your existing update workflow, and requires no manual maintenance.
Step 1: Update Your Package Lists
Always refresh the local package database before installing new software:
sudo apt update
This ensures APT fetches the most current version available in the Debian 13 repository. Skipping this step can result in APT installing an outdated package or reporting false “package not found” errors.
Step 2: Upgrade Existing Packages (Optional but Recommended)
Apply pending system updates to prevent dependency conflicts:
sudo apt upgrade
Press Y to confirm when prompted. This step is especially important on freshly deployed systems or VPS instances that have not been updated recently.
Step 3: Install 7-Zip
Install the 7zip package with a single command:
sudo apt install 7zip
APT resolves all required dependencies automatically. The download is small and installation completes within seconds on most systems.
Step 4: Verify the Installation
Confirm everything installed correctly by running the binary:
7z
You should see output similar to:
7-Zip 25.01 (x64) : Copyright (c) 1999-2025 Igor Pavlov : 2025-08-03
Usage: 7z <command> [<switches>...] <archive_name> [<file_names>...] [@listfile]
Alternatively, check the installed package record:
dpkg -l | grep 7zip
A listed entry confirms successful installation. That is everything the APT method requires — no extra configuration, no manual binary management.
Method 2: Install 7-Zip from the Official Binary
Use this method when you need the latest upstream version, want guaranteed RAR5 extraction support, or need to install 7-Zip without root access. The official binary from GitHub always uses the 7zz command and tracks upstream releases faster than APT.
Step 1: Install Required Prerequisite Tools
sudo apt install ca-certificates curl wget xz-utils
These utilities handle secure HTTPS downloads, GitHub API queries, and .tar.xz archive extraction.
Step 2: Check Your System Architecture
Download the correct binary by first identifying your CPU architecture:
dpkg --print-architecture
Common outputs: amd64 (most desktops and servers), arm64 (Raspberry Pi 4+, ARM VPS), i386 (legacy 32-bit hardware).
Step 3: Download the Latest 7-Zip Release
This command automatically fetches the latest x64 tarball from GitHub:
curl -s https://api.github.com/repos/ip7z/7zip/releases/latest | grep -oP '"browser_download_url": "\K[^"]+linux-x64[^"]+' | xargs wget
Breaking it down: curl -s silently queries GitHub’s releases API, grep -oP extracts the matching download URL using regex, and xargs wget downloads the tarball. For ARM64, substitute linux-x64 with linux-arm64. If the automated command fails, visit the official 7-Zip GitHub releases page and download the appropriate archive manually.
Step 4: Extract the Downloaded Archive
tar xf 7z*-linux-x64.tar.xz
This unpacks the 7zz binary, the 7zzs statically-linked variant, and documentation into your current directory.
Step 5: Install the Binary
System-wide (requires sudo):
sudo mv 7zz /usr/local/bin/
Current user only (no sudo required):
mkdir -p ~/.local/bin && mv 7zz ~/.local/bin/
For the user-local path, ensure ~/.local/bin is in your PATH:
echo $PATH | grep -o '.local/bin'
If nothing returns, add it permanently:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
Step 6: Confirm the Binary Works
7zz
Expected output:
7-Zip (z) 26.00 (x64) : Copyright (c) 1999-2026 Igor Pavlov : 2026-02-12
Clean up leftover files afterward:
rm 7z*-linux-x64.tar.xz 7zzs readme.txt License.txt History.txt
Essential 7-Zip Commands for Daily Use
With 7-Zip installed, the command-line interface is intuitive and consistent. The examples below use 7z. Substitute 7zz if you installed via the manual binary method.
Creating Archives
7z a archive.7z file_or_folder
The a command means “add.” Compress an entire directory including subdirectories:
7z a backup.7z ~/Documents/
Extracting Archives
Preserve directory structure during extraction:
7z x archive.7z
Extract to a specific destination (note: no space between -o and the path):
7z x archive.7z -o/path/to/destination/
Use 7z e for a flat extraction that ignores the original folder structure — useful when you only need the files themselves.
Listing Archive Contents
Preview archive contents without extracting:
7z l archive.7z
The output displays each file’s date, attributes, original size, compressed size, and relative path.
Testing Archive Integrity
Verify an archive before relying on it for backups or transfers:
7z t archive.7z
“Everything is Ok” confirms the archive is intact. Any failure output identifies which files are corrupted.
Encrypting Archives with AES-256
7z a -p -mhe=on secure.7z sensitive-folder/
-p prompts for a password interactively. -mhe=on encrypts file names alongside file contents, preventing anyone from inspecting the archive structure without the password.
Adjusting Compression Levels
7z a -mx9 maximum.7z largefile.iso # Ultra compression, slowest
7z a -mx1 fast.7z largefile.iso # Fast compression, larger output
Compression levels range from 0 (no compression, store only) to 9 (maximum ratio). The default level of 5 balances speed and size for most everyday tasks.
Splitting Large Archives
7z a -v100m split.7z large-backup/
This creates split.7z.001, split.7z.002, and so on, each capped at 100 MB. To reassemble and extract, simply run:
7z x split.7z.001
Excluding Files by Pattern
7z a backup.7z project/ -xr!*.log -xr!*.tmp -xr!node_modules
The r modifier makes each exclusion pattern recursive through all subdirectories.
Troubleshooting Common 7-Zip Issues on Debian 13
“Command Not Found” After APT Install
First, confirm the package is installed:
dpkg -l | grep 7zip
If listed, check whether the binary is accessible:
which 7z
echo $PATH
Reinstall if the binary is missing:
sudo apt install --reinstall 7zip
Architecture Mismatch Error
If you see cannot execute binary file: Exec format error after a manual install, you downloaded the wrong architecture. Verify your system type, remove the incorrect binary, and download the matching release:
dpkg --print-architecture
sudo rm /usr/local/bin/7zz
Then revisit the GitHub releases page for the correct download.
Permission Denied During Extraction
You are trying to extract into a directory you do not own. Extract to your home directory or use sudo:
sudo 7z x archive.7z -o/opt/destination/
Corrupted Archive Errors
CRC failures and data errors indicate corruption. Test the archive first:
7z t archive.7z
Re-download the file from the original source if multiple files fail. For encrypted archives reporting “Wrong password,” remember that passwords are case-sensitive — verify exact capitalization before trying again.
Uninstalling 7-Zip from Debian 13
Remove the APT Package
sudo apt remove --purge 7zip && sudo apt autoremove
--purge removes configuration files alongside the package. autoremove cleans up unused dependencies. Verify removal:
7z
# bash: 7z: command not found
Remove the Manual Binary
System-wide:
sudo rm /usr/local/bin/7zz
User-local:
rm ~/.local/bin/7zz
If you added ~/.local/bin to your ~/.bashrc, remove that export line and open a new terminal session to apply the change.
Congratulations! You have successfully installed 7-Zip. Thanks for using this tutorial for installing the latest version of 7-Zip on Debian 13 “Trixie” system. For additional help or useful information, we recommend you check the official 7-Zip website.