7z command not found

In this troubleshooting guide we learn how to fix 7z command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

7z: command not found

or when using sudo you get the following error message

sudo: 7z: command not found

Solutions to 7z: command not found

How To Fix 7z: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu 7z is provided by p7zip-full package.

p7zip-full is:

p7zip is the Unix command-line port of 7-Zip, a file archiver that handles the 7z format which features very high compression ratios.

p7zip-full provides utilities to pack and unpack 7z archives within a shell or using a GUI (such as Ark, File Roller or Nautilus).

Installing p7zip-full allows File Roller to use the very efficient 7z compression format for packing and unpacking files and directories. Additionally, it provides the 7z and 7za commands.

List of supported formats:

  • Packing / unpacking: 7z, ZIP, GZIP, BZIP2, XZ and TAR
  • Unpacking only: APM, ARJ, CAB, CHM, CPIO, CramFS, DEB, DMG, FAT, HFS, ISO, LZH, LZMA, LZMA2, MBR, MSI, MSLZ, NSIS, NTFS, RAR (only if non-free p7zip-rar package is installed), RPM, SquashFS, UDF, VHD, WIM, XAR and Z.

The dependent package, p7zip, provides 7zr, a light version of 7za, and p7zip, a gzip-like wrapper around 7zr.

To fix this problem, we can install more using the command below.

sudo apt-get -y install p7zip-full

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install p7zip-full.

sudo apt -y install p7zip-full

Or if you have aptitude installed you can use the following command.

sudo aptitude install p7zip-full

Summary

In this tutorial we learn how to fix 7z command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.