Tools: Update: How to Install 7-Zip on Ubuntu

Tools: Update: How to Install 7-Zip on Ubuntu

Source: DigitalOcean

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. Before you install 7-Zip on Ubuntu, confirm you have: 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. 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: 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: 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: 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: <$>[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: Expected output includes a version line and a list of supported formats. Examples from validation runs: List installed files when you need to debug a broken install: 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. Replace the URL with 7z2601-linux-arm64.tar.xz or another build if you run ARM hardware. To install without sudo, use a user-local directory: 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: 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: Extract everything into the current directory without paths: Send output to a specific folder: Add a single file to a new .7z archive: Add a directory recursively: Create a ZIP archive (useful when you share files with tools that expect .zip): Add -slt when you need detailed technical fields for each entry: Extract with a password: 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: This produces files such as large.7z.001, large.7z.002, and so on. Extract later with: Compress every .log file in the current directory: 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. 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: 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: Check free space with df -h before you extract large archives. Install the RAR plugin for your release: 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: 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. After you install p7zip-full, run: 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. Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases. Learn more about our products 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 Please complete your information! 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.