Categories: Ubuntu

How to Install 7-Zip (Command & GUI) in Ubuntu 22.04 & 24.04

This simple tutorial shows how to install 7-Zip file archiver in Ubuntu Desktop.

7-Zip is a popular free open-source file archiver with a high compression ratio. Ubuntu Linux can get it in few different packages:

  • p7zip – a command line port of 7-Zip for POSIX systems, including Linux, when 7-Zip was Windows-only. Discontinued since 2016, but still popular and working good.
  • p7zip-desktop – fork of p7zip with a graphical interface.
  • 7zip – 7-Zip for Linux, command line version.

NOTE: If you just want to do compress and/or extract .7z files, then Ubuntu supports the feature out-of-the-box with the Nautilus file manager.

Option
Sponsored
1: p7zip-desktop (GUI)

For beginners who prefer a graphical user interface, p7zip-desktop is the only choice as far as I know.

It’s a fork of p7zip based on 7-Zip 16.02. It’s old, discontinued, but still working good in today’s Linux Desktop.

As the screenshot above shows you, it has almost the same user interface to the Windows version. Just browse and select files and folders (Ctrl+Click or Shift+Click to select multiple files/folders) then click “Add” button to add them to archive (or create new archive), or choose an archive and click “Extract” to decompress.

To install p7zip-desktop, either open Ubuntu Software (or App Center), then search & install it as Snap package:

or, press Ctrl+Alt+T on keyboard to open terminal, and run command instead to install it:

snap install p7zip-desktop

Once installed, search for and launch it ‘p7zip-desktop’ either from start menu or Gnome overview screen depends on your desktop environment.

Option 2: 7zip .deb package (command line)

7-Zip adds native Linux support since version 21.0, which however is command line only!

Ubuntu includes the 7zip package in system repository since Ubuntu 22.04. To install it, press Ctrl+Alt+T to open terminal and run command:

sudo apt install 7zip

For Ubuntu 23.10 & 24.04, also install the RAR plugin via sudo apt install 7zip-rar command.

After installation, just run 7zz command to print version and help. It’s a standalone console version of 7-Zip, compiled for dynamic system library linking.

The basic usage of 7zz command include:

Option 3: 7zip official Linux package (command line)

As you see in the last screenshot, Ubuntu 22.04 includes 7zip version 21.07 in system repository, which is old!

For the latest version, 7zip website provides the official package via the link below:

Sponsored

If you don’t know your system type, either run uname -m or dpkg --print-architecture command in terminal (Ctrl+Alt+T) to tell.

After downloaded the package, open your Downloads folder, extract the tarball, then right-click on extracted folder and click “Open in Terminal“.

In the pop-up terminal window, run ls command will list file content in current directory. To install the 7zz console version, just run commands:

sudo install 7zz /usr/local/bin
sudo install 7zzs /usr/local/bin

Different to 7zz, 7zzs is the standalone console version of 7-Zip compiled with static system library linking.

When done, run either 7zz or 7zzs command to verify 7-Zip version and command options.

Option 4: p7zip

As mentioned above, p7zip is a fork of 7-Zip when it was Windows only. It’s discontinued since 2016, but still available in Ubuntu repository just for choice!

To install p7zip, open terminal (Ctrl+Alt+T) and run command:

sudo apt install p7zip-full --install-suggests

After installation, you got 3 command tools. Run either command to tell version and command options.

  • 7z uses plugins to handle archives.
  • 7za is a stand-alone executable that handles fewer archive formats than 7z.
  • 7zr light-version of 7za that only handles 7z archives.

Uninstall 7-Zip

Depends on which version you installed, uninstall the graphical tool p7zip-desktop either via Ubuntu Software (App Center) or by running command in terminal:

snap remove p7zip-deesktop

To remove p7zip and 7zip package installed from system repository, use command:

sudo apt remove --autoremove p7zip-full 7zip

And, to uninstall the package downloaded from 7zip website, use command:

sudo rm /usr/local/bin/7zz /usr/local/bin/7zzs

The post How to Install 7-Zip (Command & GUI) in Ubuntu 22.04 & 24.04 appeared first on Osgrove.

Ubuntu Server Admin

Recent Posts

How to Install nvidia-smi on Ubuntu or Debian Linux

In this article, we will see how to install nvidia-smi on Ubuntu or Debian Linux.…

4 hours ago

How to Install clang tool on Ubuntu or Debian Linux

In this article, we will see how to install clang tool on Ubuntu or Debian…

1 day ago

How to resolve Ubuntu 20.04 Container Signature Errors on Raspberry Pi ARM Devices

When working with Docker containers on Raspberry Pi devices, you might encounter frustrating signature verification…

2 days ago

How to fix DNS Resolution Issues with OpenVPN on Ubuntu 18.04

You’ve recently upgraded to Ubuntu 18.04 and found that your OpenVPN connection no longer resolves…

2 days ago

How to Fix Ubuntu 18.04 System Monitor Launch Issues

Have you ever tried to open System Monitor on your Ubuntu 18.04 system only to…

3 days ago

What is System Hardening? Essential Checklists from OS to Applications

System hardening means locking down a system and reducing its attack surface: removing unnecessary software…

3 days ago