Sr Technical Content Strategist and Team Lead

If you need to install 7-Zip on Ubuntu, the fastest path on Ubuntu 22.04 and 24.04 LTS is
sudo apt install p7zip-full p7zip-rar. On Ubuntu 26.04 LTS, use
sudo apt install 7zip 7zip-rar instead (package names changed in that release). Either
path installs the 7z command line tool and RAR extraction support. Ubuntu does not
ship the Windows GUI, but you get full archive handling from the terminal and from the
default file manager once the packages are in place.
7-Zip is a widely used archiver known for strong compression in
the .7z format. On Linux, Igor Pavlov’s project appears in two forms: the community
p7zip port in Ubuntu repositories, and official console builds published since 2022 that
install as 7zz. This guide covers both paths, common commands, format choices, and
troubleshooting.
Version note: The commands in this tutorial were validated on Ubuntu 22.04 LTS,
24.04 LTS, and 26.04 LTS (Resolute Raccoon). On 26.04, apt
installs the official 7zip package (7-Zip 26.00) instead of the older p7zip port,
and the RAR plugin is named 7zip-rar rather than p7zip-rar. All 7z examples
below were run successfully on a clean 26.04 cloud image. If you use a derivative
distribution, confirm package names with your vendor docs.
p7zip-full for the 7z and 7za binaries. The smaller p7zip
package only provides 7zr, which handles .7z files alone and often leads to
“unsupported archive” errors on ZIP or TAR data.p7zip-rar (22.04 and 24.04) or 7zip-rar (26.04) when you must open
.rar files. RAR support is not included in the main archiver package because of
licensing limits on the format.7z x archive.7z to keep directory paths, or 7z e archive.7z
to drop every file into the current folder.7zz binary..7z
files after p7zip-full is installed.Before you install 7-Zip on Ubuntu, confirm you have:
sudo privileges, or a user account where you can install
binaries under ~/bin for the official build.apt, or a browser to fetch the official tarball.For package management context, see How To Manage Packages in Ubuntu and Debian with Apt. If you are preparing a fresh VPS, follow Initial Server Setup with Ubuntu 22.04 before you add archiver tools.
Ubuntu splits 7-Zip functionality across several apt packages. Picking the wrong one is
a common reason installs “succeed” but commands still fail on ZIP or RAR files.
| Package | Binaries installed | Typical use | Ubuntu releases |
|---|---|---|---|
p7zip |
7zr |
Minimal .7z only workflows |
22.04, 24.04 |
p7zip-full |
7z, 7za |
General CLI use, ZIP, TAR, GZIP, BZIP2, XZ, and more | 22.04, 24.04 (transitional on 26.04) |
p7zip-rar |
RAR plugin for 7z |
Opening many .rar archives |
22.04, 24.04 |
For almost every task on 22.04 or 24.04, install p7zip-full and add
p7zip-rar when you expect .rar files.
Ubuntu 26.04 moved to the upstream 7zip source package. The transitional names
p7zip-full and p7zip are now virtual packages satisfied by 7zip:
| Package | Binaries installed | Typical use |
|---|---|---|
7zip |
7z, 7za, 7zr |
General CLI use (7-Zip 26.00 from Igor Pavlov) |
7zip-rar |
RAR plugin for 7z |
Opening many .rar archives |
On 26.04, apt install p7zip-full still works because it pulls in 7zip, but
p7zip-rar is not available. Use 7zip-rar for RAR support on that release.
The community p7zip port on SourceForge remains relevant on older LTS releases. On
26.04, the apt packages track the official 7-Zip codebase more closely, so you may
not need a manual 7zz download unless you want a newer point release than the archive
ships.
Since 2022, Igor Pavlov publishes official console builds for Linux on
7-zip.org. The current release line (for example
7-Zip 26.01) ships a tarball that contains 7zz (dynamically linked) and
7zzs (statically linked). These binaries support newer formats and fixes ahead of
the p7zip packages in Ubuntu.
Use the official build when you need the latest format support, you are comparing
behavior with Windows 7-Zip, or you cannot use sudo and prefer a user-local install.
Use p7zip-full when you want packages managed entirely by apt.
Refreshing the package index before installation helps apt resolve current versions of
p7zip-full and p7zip-rar:
- sudo apt update
Updating first also reduces mismatches when other packages were upgraded recently on the same host.
Choose the block that matches your Ubuntu release.
Install the main tools and the RAR plugin in one step:
- sudo apt install p7zip-full p7zip-rar
This command installs the 7z binary you will use in the examples below. On these
releases, 7z reports a p7zip build such as 7-Zip [64] 16.02.
Install the official 7zip package and the RAR plugin:
- sudo apt install 7zip 7zip-rar
<$>[warning]
On Ubuntu 26.04, sudo apt install p7zip-rar fails with Unable to locate package
because that package was renamed to 7zip-rar. You can still run
sudo apt install p7zip-full on 26.04 (it installs 7zip), but you must pair it with
7zip-rar for RAR files.
</$>
After install, 7z reports 7-Zip 26.00 from Igor Pavlov on a 26.04 system.
Confirm the binaries are on your PATH and print version information:
- which 7z
- 7z
Expected output includes a version line and a list of supported formats. Examples from validation runs:
7-Zip [64] 16.02 (community p7zip build)7-Zip 26.00 (arm64) or 7-Zip 26.00 (x86) (official 7zip package)List installed files when you need to debug a broken install:
- dpkg -L 7zip 2>/dev/null | grep bin/ || dpkg -L p7zip-full | grep bin/
When you need a newer point release than your apt packages provide, or you cannot use
sudo, download the tarball that matches your CPU architecture from
7-zip.org. The example below uses the 64-bit
x86-64 build for version 26.01. On Ubuntu 26.04, apt install 7zip already ships
7-Zip 26.00, so this step is optional unless you need 26.01 specifically.
- cd /tmp
- curl -LO https://github.com/ip7z/7zip/releases/download/26.01/7z2601-linux-x64.tar.xz
Replace the URL with 7z2601-linux-arm64.tar.xz or another build if you run ARM hardware.
- tar -xf 7z2601-linux-x64.tar.xz
- sudo install -m 755 7zz /usr/local/bin/
To install without sudo, use a user-local directory:
- mkdir -p ~/bin
- install -m 755 7zz ~/bin/
- echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
- source ~/.bashrc
- 7zz
You should see 7-Zip 26.01 in the header. Use 7zz in place of 7z in the command
examples below when you choose this installation path.
The general syntax is:
7z <command> [<switches>] <archive> [<files>]
Common commands include a (add to archive), x (extract with paths), e (extract
without paths), and l (list). Run 7z with no arguments to print the full command list
for your installed version.
Preserve directories with x:
- 7z x archive.7z
Extract everything into the current directory without paths:
- 7z e archive.7z
Send output to a specific folder:
- 7z x archive.7z -o./output_dir
Add a single file to a new .7z archive:
- 7z a data.7z data.txt
Add a directory recursively:
- 7z a backup.7z /path/to/project/
Create a ZIP archive (useful when you share files with tools that expect .zip):
- 7z a -tzip archive.zip file1.txt file2.txt
- 7z l archive.7z
Add -slt when you need detailed technical fields for each entry:
- 7z l -slt archive.7z
- 7z a -psecret secure.7z sensitive.txt
Extract with a password:
- 7z x secure.7z -psecret
Replace secret with a strong password. Anyone with shell history logging should prefer
-p without the password on the command line so the shell prompts interactively.
Create 100 megabyte volumes:
- 7z a -v100m large.7z big.iso
This produces files such as large.7z.001, large.7z.002, and so on. Extract later
with:
- 7z x large.7z.001
Compress every .log file in the current directory:
- 7z a logs.7z ./*.log
When you manage many files across the filesystem, combine find with 7-Zip. See
How To Use Find and Locate to Search for Files on Linux
for search patterns you can pipe into archive workflows.
On Ubuntu Desktop, open Files (Nautilus), right-click a file or folder, and choose
Compress or Extract Here. GNOME Archive Manager handles .7z files when
p7zip-full is installed. This path mirrors the GUI workflow from Windows, without a
separate 7-Zip desktop application.
| Format | Typical command | Strengths | Tradeoffs |
|---|---|---|---|
.7z |
7z a archive.7z files/ |
Strong compression, encryption | Slower; not universal on every OS |
.zip |
7z a -tzip archive.zip files/ |
Wide compatibility | Weaker compression than .7z |
.tar.gz |
tar -czf archive.tar.gz files/ |
Native on Linux, fast tooling | Two-step convention; use tar for pure Linux pipelines |
Choose 7z when you control both sides of the transfer and want smaller archives. Choose
zip when recipients expect Windows-friendly containers. Choose tar.gz when you
already standardize on GNU tar for backups and deployments. For deeper tar examples,
read How To Use Tar on Linux.
Compared with xz, zstd, and bzip2, 7-Zip focuses on all-in-one archiving (combining many files, optional encryption, and split volumes). Native compressors often win on single-file speed or ratio for one stream, yet they do not replace a full archiver when you need one file bundle.
If the shell reports 7z: command not found, the package install may have failed or your
PATH omits /usr/bin. Reinstall and check:
- sudo apt install --reinstall p7zip-full
- command -v 7z
When you installed 7zz manually, confirm /usr/local/bin or ~/bin appears in
echo $PATH.
Extraction fails with permission errors when the target directory is not writable or disk space is full. Extract to a directory you own:
- 7z x archive.7z -o"$HOME/extracted"
Check free space with df -h before you extract large archives.
Install the RAR plugin for your release:
- sudo apt install p7zip-rar
On Ubuntu 26.04, use sudo apt install 7zip-rar instead.
Some newer RAR revisions may still fail because of format changes. In that case try the
official 7zz build from 7-zip.org, which tracks
Igor Pavlov’s latest decoders.
Update package lists, then install packages for your Ubuntu version:
- sudo apt update
- sudo apt install p7zip-full p7zip-rar
On Ubuntu 26.04 LTS, use sudo apt install 7zip 7zip-rar instead.
Verify with 7z. On desktop systems you can also use Archive Manager after the install
finishes.
Yes. Linux users can install the community p7zip packages through apt, or download
the official 7zz console build from 7-zip.org.
There is no official Linux GUI from the 7-Zip project, but desktop environments integrate
the command line tools into file managers.
7-Zip works on Ubuntu through p7zip-full on 22.04 and 24.04, through the 7zip
package on 26.04, and through the official 7zz tarball when you need a newer point
release than apt provides. All approaches run on current Ubuntu LTS versions without
extra compilers or build steps.
Common alternatives include File Roller with p7zip backends for simple GUI tasks,
PeaZip for a cross-platform desktop app, and native tools such as tar, gzip,
and zstd for compression pipelines that do not require the .7z container. Many
teams keep tar.gz for Linux-only backups and add 7-Zip when they exchange files with
Windows users.
.7z file on Ubuntu from the terminal?After you install p7zip-full, run:
- 7z x filename.7z
Use 7z e filename.7z only when you want every extracted file in the current directory
without subfolders.
You can install 7-Zip on Ubuntu with p7zip-full and p7zip-rar on 22.04 and 24.04, or
with 7zip and 7zip-rar on 26.04 LTS. You can also deploy the official 7zz binary
when you need a newer point release than your archive provides. You also know how to
create archives, list contents, protect files with passwords, and split large bundles
from the terminal or the desktop file manager.
rsync. See
How To Use Rsync to Sync Local and Remote Directories..tar.gz assets with .7z bundles on the same fleet.Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
I help Businesses scale with AI x SEO x (authentic) Content that revives traffic and keeps leads flowing | 3,000,000+ Average monthly readers on Medium | Sr Technical Writer(Team Lead) @ DigitalOcean | Ex-Cloud Consultant @ AMEX | Ex-Site Reliability Engineer(DevOps)@Nutanix
Hi There is any dependecy to use sudo apt update before installing 7zip
- vikas
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.