7-Zip delivers high compression ratios, support for formats like 7z, ZIP, RAR, and TAR, and dependable performance whether you are archiving project backups or unpacking large downloads. Although the tool gained fame on Windows, the upstream Linux binary ships the same features on Ubuntu without waiting for distro packages to catch up.
This guide shows how to install the official 7-Zip tarball so you always run the newest release, verify the download, place the binary system-wide, practice everyday commands, and troubleshoot common issues. Manual installation keeps you in control of update timing, while the included automation tricks make grabbing fresh builds quick when you need them.
Update Ubuntu Before 7-Zip Installation
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
Ubuntu ships the community-built p7zip packages that expose commands such as
7z,7za, and7zr. The official binary installed in this guide uses the7zzcommand instead, so both implementations can coexist without conflicts. Keep the distro packages for Nautilus/File Roller integration and scripts that rely on7z, and use7zzwhenever you want the upstream feature set.
Download 7-Zip Binary Archive
The official 7-Zip download page publishes fresh tarballs for x86-64 and ARM64 Linux builds. Choose either the manual version-specific download (you control the exact build) or the automatic method that always grabs whatever release the developers list first.
Download a Specific 7-Zip Release (Manual)
Select the version and architecture you want directly from the download page, then copy its filename. This example uses version 25.01 for the 64-bit Linux x86-64 build because most desktops and laptops run that architecture. ARM-based devices should swap in the ARM64 archive instead.

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, let curl discover the newest tarball by parsing the download page each time you run the command. The one-liner below fetches the HTML, extracts the first x86-64 archive link, and downloads it using the remote filename.
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)"
This command always grabs the latest x86-64 build listed on the page. Switch
x64toarm64inside the regular expression when working on ARM hardware. Because the script rewrites the relative download path into a full URL automatically, rerun it whenever you want to refresh 7-Zip and you will always download the newest release.
Verify Download Integrity (Optional)
For enhanced security, verify the downloaded archive matches the official release. The 7-Zip download page provides SHA-256 checksums for each file; SHA-256 is a cryptographic fingerprint you can compare against the official value to ensure the download hasn’t been modified. Compare the checksum of your download:
sha256sum 7z2501-linux-x64.tar.xz
Replace the filename with whatever archive you downloaded (the automatic method saves the current version name) and match the output against the checksum listed on the official 7-Zip download page. If they match, the download is authentic and uncorrupted. This verification step is particularly important when downloading software 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. This keeps your home directory clean and makes the installation process easier to manage:
mkdir 7zip
Extract the downloaded tar.xz archive into the newly created directory. The x flag extracts files, f specifies the filename, and -C directs extraction to the target directory:
tar xf 7z2501-linux-x64.tar.xz -C 7zip
Test the 7-Zip Binary
Navigate to the extraction directory to test the binary before installing it system-wide:
cd 7zip
Run 7-Zip to verify the installation and view the available commands. The ./ prefix executes the binary from the current directory:
./7zz
The output displays the 7-Zip version, copyright information, and a list of available commands. 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 software you manage manually. Using install copies the file, sets the correct ownership, and locks down permissions so regular users cannot accidentally overwrite the binary:
sudo install -m 755 ~/7zip/7zz /usr/local/bin/7zz
The 7zz binary is now root-owned and accessible from any directory. Repeat the command for 7zzs if you also want the stripped variant (sudo install -m 755 ~/7zip/7zzs /usr/local/bin/7zzs). Verify the installation:
7zz --help

Common 7-Zip Commands and Usage Examples
7-Zip uses the 7zz command with single-letter subcommands for various operations. The most common tasks involve creating archives (a), extracting files (x), listing contents (l), updating existing archives (u), and testing integrity (t). These examples demonstrate practical usage patterns for everyday file compression tasks.
Create an Archive
The a (add) command creates new archives or adds files to existing ones. The basic syntax specifies the archive name followed by the files or directories to compress:
7zz a <archive_name> <file_or_directory>
For example, to create a 7z archive named example.7z containing a file called 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
The x (extract with full paths) command extracts archives while preserving the original directory structure. This differs from the e command which extracts all files to a single flat directory:
7zz x <archive_name>
For example, to extract the contents of an archive named 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
The l (list) command displays archive contents without extracting files. This helps verify what’s inside an archive before extraction, showing file names, sizes, modification dates, and compression ratios:
7zz l <archive_name>
For example, to list the contents of an archive named 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
The u (update) command adds new files or replaces existing files in an archive when they’ve been modified. This is more efficient than recreating the entire archive, as it only updates changed files:
7zz u <archive_name> <file_or_directory>
For example, if you have an existing archive named example.7z and you want to update it 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
The t (test) command verifies archive integrity by checking for corruption, incomplete downloads, or data errors. This is particularly useful after transferring files over networks or recovering archives from backup media:
7zz t <archive_name>
For example, to test the integrity of an archive named example.7z:
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
Command Not Found After Installation
If the 7zz command returns “command not found” after installation, verify the binary location and PATH configuration:
ls -l /usr/local/bin/7zz
If the file exists but still isn’t recognized, check that /usr/local/bin is in your PATH. PATH is the shell’s search order for executables, just like the PATH environment variable in Windows tells Command Prompt where to find programs:
echo $PATH | grep -o '/usr/local/bin'
If the directory isn’t listed, append it to your shell configuration so every new terminal session inherits the setting:
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Zsh users should update ~/.zshrc instead. After reloading the configuration, re-run 7zz --help to confirm the shell now finds the binary.
Permission Denied Errors
If you encounter permission errors when running 7zz, verify the binary has executable permissions:
sudo chmod +x /usr/local/bin/7zz
Use 7zz Alongside p7zip Packages
Keeping Ubuntu’s p7zip-full package installed is safe because it exposes the 7z command while the upstream binary uses 7zz. You can run both side by side; use 7z when desktop apps call it automatically and switch to 7zz for the newest upstream syntax. Only remove the distro package if you prefer to manage a single implementation.
Unsupported Architecture
If 7-Zip fails to run with “cannot execute binary file: Exec format error,” you downloaded the wrong architecture. Check your system architecture:
uname -m
Download the appropriate binary: x86_64 systems need the x64 version, while aarch64 systems require the ARM64 version from the 7-Zip download page.
Conclusion
7-Zip delivers powerful file compression with high compression ratios and support for numerous archive formats including 7z, ZIP, RAR, TAR, and GZIP. The manual installation process provides the official binary with current features, performance improvements, and security updates directly from the developers. Your Ubuntu system now handles archive operations efficiently through a single unified tool. For updates, periodically visit the official 7-Zip download page and repeat the installation process with the newer version.
Thanks