7-Zip handles archive operations with high compression ratios and reads formats including 7z, ZIP, RAR, TAR, and GZIP. Installing the official binary from 7-Zip.org puts the 7zz command system-wide so you can compress project backups before archiving them to external drives, extract downloaded software distributions, and verify archive integrity when transferring files across networks.
This guide walks through downloading the official 7-Zip binary, verifying the archive integrity, installing it system-wide alongside Ubuntu’s p7zip packages, and using the core compression commands. You will understand the difference between Ubuntu’s 7z command and the upstream 7zz binary, choose the installation method that fits your workflow, and troubleshoot common installation problems.
Choose Your 7-Zip Installation Method
Ubuntu provides two ways to install 7-Zip: the community-maintained p7zip package from default repositories and the official upstream binary from 7-Zip.org. The p7zip package integrates with file managers and uses the 7z command, while the upstream binary provides the latest features with the 7zz command. Both can coexist on the same system without conflicts.
| Method | Channel | Version | Updates | Best For |
|---|---|---|---|---|
| APT | Ubuntu Repos | Stable | Automatic via apt upgrade | Desktop integration, file manager support, distro package preference |
| Official Binary | 7-Zip.org | Latest | Manual reinstallation | Newest features, upstream command syntax, manual version control |
This guide documents the official binary installation method. If you prefer automatic updates and file manager integration, install p7zip instead with
sudo apt install p7zip-full. Both implementations can run side by side—use7zwhen desktop apps call it automatically and switch to7zzfor the newest upstream features.
Update System Packages
Open the terminal with Ctrl + Alt + T, the Ubuntu equivalent of Command Prompt or PowerShell on Windows. With the terminal ready, update your system packages to ensure compatibility and security:
sudo apt update && sudo apt upgrade
Most Ubuntu installations include curl by default, but minimal cloud images may omit it. If the download commands below fail with “command not found,” install curl first with
sudo apt install curl.
Download 7-Zip Binary Archive
The official 7-Zip download page publishes tarballs for x86-64 and ARM64 Linux builds. Choose the manual method when you need a specific version or the automatic method that detects the latest release from the download page each time you run it.
Download a Specific 7-Zip Release (Manual)
Before downloading, verify your system architecture with uname -m. The output shows x86_64 for 64-bit Intel/AMD systems or aarch64 for ARM64 devices. Most Ubuntu desktops and laptops run x86-64 architecture.
Check your architecture:
uname -m
x86_64
Once confirmed, select the matching version and architecture directly from the download page. This example uses version 25.01 for x86-64, but you should download the current release shown on the official page.

Download that exact build with curl:
curl -fsSLo 7z2501-linux-x64.tar.xz https://www.7-zip.org/a/7z2501-linux-x64.tar.xz
The version number in the filename (7z2501) corresponds to 7-Zip version 25.01. Replace both the numeric portion and the architecture suffix when newer builds (for example 7z2505 or 7z2601) appear on the download page.
Automatically Download the Latest 7-Zip Release
If you prefer not to track version numbers manually, use this command that parses the download page each time to grab the latest x86-64 release automatically:
curl -fsSLO "https://www.7-zip.org/$(curl -fsSL https://www.7-zip.org/download.html | grep -Eo 'a/7z[0-9]{4}-linux-x64\.tar\.xz' | head -n 1)"
Switch
x64toarm64inside the regular expression when working on ARM hardware. Rerun the command whenever you want to upgrade—it always detects and downloads the newest release from the official page.
Verify Download Integrity (Optional)
For enhanced security, verify the downloaded archive matches the official release using SHA-256 checksums. The 7-Zip download page lists checksums for each file—compare your local file’s checksum against the published value to confirm the download is authentic and uncorrupted.
Calculate the checksum:
sha256sum 7z2501-linux-x64.tar.xz
d5b20a1d1e3f5e4a46b7c7b9f4c7a6c7a6c7a6c7a6c7a6c7a6c7a6c7a6c7a6c7 7z2501-linux-x64.tar.xz
Match this output against the checksum published on the official 7-Zip download page. If they match character-for-character, the download is authentic and uncorrupted. This verification step is particularly important when downloading binaries that will run with elevated privileges.
Extract and Install 7-Zip
Extract the 7-Zip Archive
Create a dedicated directory to organize the extracted files:
mkdir 7zip
Extract the tar.xz archive into the newly created directory:
tar xf 7z2501-linux-x64.tar.xz -C 7zip
Test the 7-Zip Binary
Navigate to the extraction directory and test the binary before installing it system-wide:
cd 7zip
./7zz
7-Zip (z) 25.01 (x64) : Copyright (c) 1999-2025 Igor Pavlov : 2025-08-03 64-bit locale=C.UTF-8 Threads:4 OPEN_MAX:1024, ASM Usage: 7zz <command> [<switches>...] <archive_name> [<file_names>...] <Commands> a : Add files to archive b : Benchmark d : Delete files from archive e : Extract files from archive (without using directory names) h : Calculate hash values for files i : Show information about supported formats l : List contents of archive rn : Rename files in archive t : Test integrity of archive u : Update files to archive x : eXtract files with full paths
The output displays the 7-Zip version, available commands, and usage syntax. Once confirmed working, proceed to install it system-wide for convenient access from any directory.
Install 7-Zip System-Wide
Install the 7-Zip binary to /usr/local/bin, which is reserved for manually managed software:
sudo install -m 755 ~/7zip/7zz /usr/local/bin/7zz
The extraction directory also contains
7zzs, a stripped variant with reduced executable size for space-constrained systems. Most users only need7zz. If you need the stripped version, install it withsudo install -m 755 ~/7zip/7zzs /usr/local/bin/7zzs.
Verify System-Wide Installation
Confirm the binary is accessible from any directory:
which 7zz
/usr/local/bin/7zz
Test the command:
7zz --help

Common 7-Zip Commands and Usage Examples
7-Zip uses single-letter subcommands for common operations: a (add/create), x (extract with paths), l (list), u (update), and t (test integrity). The examples below cover everyday compression tasks you will use when archiving projects, extracting downloads, and verifying file integrity.
Create an Archive
Create new archives with the a (add) command:
7zz a <archive_name> <file_or_directory>
To create a 7z archive named example.7z containing file.txt:
7zz a example.7z file.txt
This command creates an archive named example.7z and adds file.txt to it. You can replace file.txt with a directory name to archive an entire directory structure with all its contents. 7-Zip automatically preserves file permissions and directory hierarchies.
Extract an Archive
Extract archives while preserving directory structure with the x command:
7zz x <archive_name>
To extract example.7z:
7zz x example.7z
This command extracts the contents of example.7z to the current directory, maintaining the original folder structure. Files and subdirectories appear exactly as they were when archived.
List Archive Contents
Display archive contents without extracting with the l command:
7zz l <archive_name>
To list contents of example.7z:
7zz l example.7z
The output displays files and directories contained within example.7z along with metadata like compressed and uncompressed sizes, helping you understand the archive contents and compression efficiency without extraction.
Update an Existing Archive
Add new files or replace modified files in existing archives with the u command:
7zz u <archive_name> <file_or_directory>
To update example.7z with a modified file.txt:
7zz u example.7z file.txt
This command updates the example.7z archive with the latest version of file.txt. If the file doesn’t exist in the archive, 7-Zip adds it as a new entry.
Test Archive Integrity
Verify archive integrity after downloads or file transfers with the t command:
7zz t <archive_name>
To test example.7z integrity:
7zz t example.7z
The command verifies all files within example.7z and reports “Everything is Ok” if the archive is intact, or displays specific error messages if corruption is detected. This validation step should be performed before extracting important archives.
Fix Common 7-Zip Installation Problems
Unsupported Architecture Error
If 7-Zip fails to run with “cannot execute binary file: Exec format error,” you downloaded the wrong architecture. Verify your system architecture:
uname -m
x86_64
Download the appropriate binary: x86_64 systems need the x64 version, while aarch64 systems require the ARM64 version from the 7-Zip download page. Remove the incorrect binary with sudo rm /usr/local/bin/7zz before reinstalling.
Command Not Found After Installation
If the 7zz command returns “command not found” after installation, verify the binary exists:
ls -l /usr/local/bin/7zz
-rwxr-xr-x 1 root root 2926592 Dec 9 12:00 /usr/local/bin/7zz
If the file exists but the command still fails, check that /usr/local/bin is in your PATH (the shell’s search order for executables):
echo $PATH | grep -o '/usr/local/bin'
/usr/local/bin
If the directory is not listed, add it to your shell configuration:
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Zsh users should update ~/.zshrc instead. After reloading the configuration, confirm the shell finds the binary with 7zz --help.
Permission Denied Errors
If you encounter permission errors when running 7zz, verify the binary has executable permissions:
sudo chmod +x /usr/local/bin/7zz
Old Version Shows After Upgrade
If 7zz --version shows an outdated version after reinstalling, the shell cached the old binary location. Clear the hash table:
hash -r
7zz --version
The command now shows the current version. This issue only affects the current terminal session; new terminals will use the updated binary automatically.
Archive Corruption During Download
If extraction fails with “Can not open the file as archive” or similar errors, the download may be corrupted. Verify the checksum as shown in the verification section above. If the checksum doesn’t match, delete the corrupted file and re-download:
rm 7z2501-linux-x64.tar.xz
curl -fsSLo 7z2501-linux-x64.tar.xz https://www.7-zip.org/a/7z2501-linux-x64.tar.xz
sha256sum 7z2501-linux-x64.tar.xz
Remove 7-Zip
If you no longer need the manual 7-Zip installation, remove the system-wide binary and cleanup the extraction directory:
sudo rm /usr/local/bin/7zz /usr/local/bin/7zzs
rm -rf ~/7zip
rm ~/7z2501-linux-x64.tar.xz
Replace the tarball filename with whatever version you downloaded. If you installed Ubuntu’s p7zip package alongside the manual installation, remove it separately:
sudo apt remove p7zip-full
Verify removal by checking that the commands no longer exist:
which 7zz
which 7z
Both commands should return no output, confirming complete removal.
Conclusion
7-Zip provides powerful compression with support for 7z, ZIP, RAR, TAR, and GZIP formats. Installing the official binary from 7-Zip.org gives you direct access to the latest features and upstream command syntax through the 7zz command. Your Ubuntu system now compresses project backups efficiently, extracts downloaded software distributions, and verifies archive integrity using cryptographic checksums. When you need newer releases, revisit the 7-Zip download page and repeat the installation process with the updated tarball. For related compression workflows, explore unzip command examples when working with standard ZIP archives that don’t require 7-Zip’s advanced features.
Thanks