Report this

What is the reason for this report?

How to Install 7-Zip on Ubuntu

Updated on May 19, 2026
Anish Singh Walia

By Anish Singh Walia

Sr Technical Content Strategist and Team Lead

How to Install 7-Zip on Ubuntu

Introduction

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.

Key takeaways

  • Install 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.
  • Add 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.
  • Extract with 7z x archive.7z to keep directory paths, or 7z e archive.7z to drop every file into the current folder.
  • For the newest features from the upstream author, download the official Linux build from 7-zip.org and use the 7zz binary.
  • On Ubuntu Desktop, File Roller (Archive Manager) can compress and extract .7z files after p7zip-full is installed.

Prerequisites

Before you install 7-Zip on Ubuntu, confirm you have:

  • An Ubuntu system with sudo privileges, or a user account where you can install binaries under ~/bin for the official build.
  • Network access to Ubuntu mirrors for apt, or a browser to fetch the official tarball.
  • Basic terminal familiarity. If you are new to the shell, read An Introduction to the Linux Terminal and An Introduction to Linux Basics.

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.

Understanding the 7-Zip packages available on Ubuntu

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.

p7zip vs p7zip-full vs p7zip-rar

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 LTS package names

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.

The official 7-Zip Linux binary (7-Zip 21.x and later)

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.

Step 1: Update your package index

Refreshing the package index before installation helps apt resolve current versions of p7zip-full and p7zip-rar:

  1. sudo apt update

Updating first also reduces mismatches when other packages were upgraded recently on the same host.

Step 2: Install 7-Zip using apt

Choose the block that matches your Ubuntu release.

Ubuntu 22.04 and 24.04 LTS

Install the main tools and the RAR plugin in one step:

  1. 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.

Ubuntu 26.04 LTS and later

Install the official 7zip package and the RAR plugin:

  1. 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.

Verify the installation

Confirm the binaries are on your PATH and print version information:

  1. which 7z
  2. 7z

Expected output includes a version line and a list of supported formats. Examples from validation runs:

  • 22.04 / 24.04: 7-Zip [64] 16.02 (community p7zip build)
  • 26.04: 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:

  1. dpkg -L 7zip 2>/dev/null | grep bin/ || dpkg -L p7zip-full | grep bin/

Step 3: Install the official 7-Zip binary (alternative method)

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.

Download the official 7-Zip Linux release

  1. cd /tmp
  2. 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.

Extract and move the binary to your PATH

  1. tar -xf 7z2601-linux-x64.tar.xz
  2. sudo install -m 755 7zz /usr/local/bin/

To install without sudo, use a user-local directory:

  1. mkdir -p ~/bin
  2. install -m 755 7zz ~/bin/
  3. echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
  4. source ~/.bashrc

Verify the official binary version

  1. 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.

How to use 7-Zip on Ubuntu: core commands

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.

Extract an archive

Preserve directories with x:

  1. 7z x archive.7z

Extract everything into the current directory without paths:

  1. 7z e archive.7z

Send output to a specific folder:

  1. 7z x archive.7z -o./output_dir

Create a compressed archive

Add a single file to a new .7z archive:

  1. 7z a data.7z data.txt

Add a directory recursively:

  1. 7z a backup.7z /path/to/project/

Create a ZIP archive (useful when you share files with tools that expect .zip):

  1. 7z a -tzip archive.zip file1.txt file2.txt

List contents of an archive without extracting

  1. 7z l archive.7z

Add -slt when you need detailed technical fields for each entry:

  1. 7z l -slt archive.7z

Add password protection to an archive

  1. 7z a -psecret secure.7z sensitive.txt

Extract with a password:

  1. 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.

Split a large archive into multiple parts

Create 100 megabyte volumes:

  1. 7z a -v100m large.7z big.iso

This produces files such as large.7z.001, large.7z.002, and so on. Extract later with:

  1. 7z x large.7z.001

Batch compression from the terminal

Compress every .log file in the current directory:

  1. 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.

Compress and extract files with the file manager

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.

Compression format comparison

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.

Troubleshooting common issues

Command not found after installation

If the shell reports 7z: command not found, the package install may have failed or your PATH omits /usr/bin. Reinstall and check:

  1. sudo apt install --reinstall p7zip-full
  2. command -v 7z

When you installed 7zz manually, confirm /usr/local/bin or ~/bin appears in echo $PATH.

Cannot open output file errors

Extraction fails with permission errors when the target directory is not writable or disk space is full. Extract to a directory you own:

  1. 7z x archive.7z -o"$HOME/extracted"

Check free space with df -h before you extract large archives.

Unsupported method errors when opening RAR files

Install the RAR plugin for your release:

  1. 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.

FAQs

1. How do I install 7-Zip on Ubuntu?

Update package lists, then install packages for your Ubuntu version:

  1. sudo apt update
  2. 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.

2. Is 7-Zip available on Linux?

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.

3. Does 7-Zip work on Ubuntu?

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.

4. What is the alternative to 7-Zip in Ubuntu?

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.

5. How do I extract a .7z file on Ubuntu from the terminal?

After you install p7zip-full, run:

  1. 7z x filename.7z

Use 7z e filename.7z only when you want every extracted file in the current directory without subfolders.

Conclusion

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.

Continue learning with DigitalOcean

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author

Anish Singh Walia
Anish Singh Walia
Author
Sr Technical Content Strategist and Team Lead
See author profile

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

Still looking for an answer?

Was this helpful?

Hi There is any dependecy to use sudo apt update before installing 7zip

- vikas

Creative CommonsThis work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
Join the Tech Talk
Success! Thank you! Please check your email for further details.

Please complete your information!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Dark mode is coming soon.